• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 
5 #ifndef CEF_LIBCEF_COMMON_COMMAND_LINE_IMPL_H_
6 #define CEF_LIBCEF_COMMON_COMMAND_LINE_IMPL_H_
7 #pragma once
8 
9 #include "include/cef_command_line.h"
10 #include "libcef/common/value_base.h"
11 
12 #include "base/command_line.h"
13 
14 // CefCommandLine implementation
15 class CefCommandLineImpl
16     : public CefValueBase<CefCommandLine, base::CommandLine> {
17  public:
18   CefCommandLineImpl(base::CommandLine* value,
19                      bool will_delete,
20                      bool read_only);
21 
22   CefCommandLineImpl(const CefCommandLineImpl&) = delete;
23   CefCommandLineImpl& operator=(const CefCommandLineImpl&) = delete;
24 
25   // CefCommandLine methods.
26   bool IsValid() override;
27   bool IsReadOnly() override;
28   CefRefPtr<CefCommandLine> Copy() override;
29   void InitFromArgv(int argc, const char* const* argv) override;
30   void InitFromString(const CefString& command_line) override;
31   void Reset() override;
32   void GetArgv(std::vector<CefString>& argv) override;
33   CefString GetCommandLineString() override;
34   CefString GetProgram() override;
35   void SetProgram(const CefString& program) override;
36   bool HasSwitches() override;
37   bool HasSwitch(const CefString& name) override;
38   CefString GetSwitchValue(const CefString& name) override;
39   void GetSwitches(SwitchMap& switches) override;
40   void AppendSwitch(const CefString& name) override;
41   void AppendSwitchWithValue(const CefString& name,
42                              const CefString& value) override;
43   bool HasArguments() override;
44   void GetArguments(ArgumentList& arguments) override;
45   void AppendArgument(const CefString& argument) override;
46   void PrependWrapper(const CefString& wrapper) override;
47 
48   // Must hold the controller lock while using this value.
command_line()49   const base::CommandLine& command_line() { return const_value(); }
50 };
51 
52 #endif  // CEF_LIBCEF_COMMON_COMMAND_LINE_IMPL_H_
53