• 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   // CefCommandLine methods.
23   bool IsValid() override;
24   bool IsReadOnly() override;
25   CefRefPtr<CefCommandLine> Copy() override;
26   void InitFromArgv(int argc, const char* const* argv) override;
27   void InitFromString(const CefString& command_line) override;
28   void Reset() override;
29   void GetArgv(std::vector<CefString>& argv) override;
30   CefString GetCommandLineString() override;
31   CefString GetProgram() override;
32   void SetProgram(const CefString& program) override;
33   bool HasSwitches() override;
34   bool HasSwitch(const CefString& name) override;
35   CefString GetSwitchValue(const CefString& name) override;
36   void GetSwitches(SwitchMap& switches) override;
37   void AppendSwitch(const CefString& name) override;
38   void AppendSwitchWithValue(const CefString& name,
39                              const CefString& value) override;
40   bool HasArguments() override;
41   void GetArguments(ArgumentList& arguments) override;
42   void AppendArgument(const CefString& argument) override;
43   void PrependWrapper(const CefString& wrapper) override;
44 
45   // Must hold the controller lock while using this value.
command_line()46   const base::CommandLine& command_line() { return const_value(); }
47 
48   DISALLOW_COPY_AND_ASSIGN(CefCommandLineImpl);
49 };
50 
51 #endif  // CEF_LIBCEF_COMMON_COMMAND_LINE_IMPL_H_
52