Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit d03b45e

Browse files
committed
Moved client_switches files under a new common folder
1 parent 58a7d05 commit d03b45e

File tree

7 files changed

+75
-39
lines changed

7 files changed

+75
-39
lines changed

appshell/cefclient.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "include/cef_runnable.h"
1515
#include "include/cef_web_plugin.h"
1616
#include "client_handler.h"
17-
#include "client_switches.h"
17+
#include "appshell/common/client_switches.h"
1818
#include "string_util.h"
1919
#include "util.h"
2020
#include "config.h"
@@ -57,30 +57,30 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<ClientApp> app) {
5757

5858
#if defined(OS_WIN)
5959
settings.multi_threaded_message_loop =
60-
g_command_line->HasSwitch(cefclient::kMultiThreadedMessageLoop);
60+
g_command_line->HasSwitch(client::switches::kMultiThreadedMessageLoop);
6161
#endif
6262

6363
CefString(&settings.cache_path) =
64-
g_command_line->GetSwitchValue(cefclient::kCachePath);
64+
g_command_line->GetSwitchValue(client::switches::kCachePath);
6565
CefString(&settings.log_file) =
66-
g_command_line->GetSwitchValue(cefclient::kLogFile);
66+
g_command_line->GetSwitchValue(client::switches::kLogFile);
6767

6868
{
69-
std::string str = g_command_line->GetSwitchValue(cefclient::kLogSeverity);
69+
std::string str = g_command_line->GetSwitchValue(client::switches::kLogSeverity);
7070

7171
// Default to LOGSEVERITY_DISABLE
7272
settings.log_severity = LOGSEVERITY_DISABLE;
7373

7474
if (!str.empty()) {
75-
if (str == cefclient::kLogSeverity_Verbose)
75+
if (str == client::switches::kLogSeverity_Verbose)
7676
settings.log_severity = LOGSEVERITY_VERBOSE;
77-
else if (str == cefclient::kLogSeverity_Info)
77+
else if (str == client::switches::kLogSeverity_Info)
7878
settings.log_severity = LOGSEVERITY_INFO;
79-
else if (str == cefclient::kLogSeverity_Warning)
79+
else if (str == client::switches::kLogSeverity_Warning)
8080
settings.log_severity = LOGSEVERITY_WARNING;
81-
else if (str == cefclient::kLogSeverity_Error)
81+
else if (str == client::switches::kLogSeverity_Error)
8282
settings.log_severity = LOGSEVERITY_ERROR;
83-
else if (str == cefclient::kLogSeverity_Disable)
83+
else if (str == client::switches::kLogSeverity_Disable)
8484
settings.log_severity = LOGSEVERITY_DISABLE;
8585
}
8686
}
@@ -91,7 +91,7 @@ void AppGetSettings(CefSettings& settings, CefRefPtr<ClientApp> app) {
9191
//CefString(&settings.locale) = app->GetCurrentLanguage( );
9292

9393
CefString(&settings.javascript_flags) =
94-
g_command_line->GetSwitchValue(cefclient::kJavascriptFlags);
94+
g_command_line->GetSwitchValue(client::switches::kJavascriptFlags);
9595

9696
// Enable dev tools
9797
settings.remote_debugging_port = REMOTE_DEBUGGING_PORT;

appshell/cefclient_gtk.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "include/cef_frame.h"
1616
#include "include/cef_runnable.h"
1717
#include "client_handler.h"
18-
#include "client_switches.h"
18+
#include "appshell/common/client_switches.h"
1919
#include "appshell_node_process.h"
2020

2121
static std::string APPICONS[] = {"appshell32.png","appshell48.png","appshell128.png","appshell256.png"};
@@ -174,8 +174,8 @@ int main(int argc, char* argv[]) {
174174

175175
CefRefPtr<CefCommandLine> cmdLine = AppGetCommandLine();
176176

177-
if (cmdLine->HasSwitch(cefclient::kStartupPath)) {
178-
szInitialUrl = cmdLine->GetSwitchValue(cefclient::kStartupPath);
177+
if (cmdLine->HasSwitch(client::switches::kStartupPath)) {
178+
szInitialUrl = cmdLine->GetSwitchValue(client::switches::kStartupPath);
179179
} else {
180180
szInitialUrl = AppGetRunningDirectory();
181181
szInitialUrl.append("/dev/src/index.html");

appshell/cefclient_mac.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "config.h"
2020
#include "appshell_extensions.h"
2121
#include "command_callbacks.h"
22-
#include "client_switches.h"
22+
#include "appshell/common/client_switches.h"
2323
#include "native_menu_model.h"
2424
#include "appshell_node_process.h"
2525

@@ -850,8 +850,8 @@ int main(int argc, char* argv[]) {
850850
CFRelease(event);
851851

852852
CefRefPtr<CefCommandLine> cmdLine = AppGetCommandLine();
853-
if (cmdLine->HasSwitch(cefclient::kStartupPath)) {
854-
CefString cmdLineStartupURL = cmdLine->GetSwitchValue(cefclient::kStartupPath);
853+
if (cmdLine->HasSwitch(client::switches::kStartupPath)) {
854+
CefString cmdLineStartupURL = cmdLine->GetSwitchValue(client::switches::kStartupPath);
855855
std::string startupURLStr(cmdLineStartupURL);
856856
NSString* str = [NSString stringWithUTF8String:startupURLStr.c_str()];
857857
startupUrl = [NSURL fileURLWithPath:[str stringByExpandingTildeInPath]];

appshell/cefclient_win.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "config.h"
1919
#include "resource.h"
2020
#include "string_util.h"
21-
#include "client_switches.h"
21+
#include "appshell/common/client_switches.h"
2222
#include "native_menu_model.h"
2323
#include "appshell_node_process.h"
2424

@@ -240,8 +240,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
240240
CefInitialize(main_args, settings, app.get(), NULL);
241241

242242
CefRefPtr<CefCommandLine> cmdLine = AppGetCommandLine();
243-
if (cmdLine->HasSwitch(cefclient::kStartupPath)) {
244-
wcscpy(szInitialUrl, cmdLine->GetSwitchValue(cefclient::kStartupPath).c_str());
243+
if (cmdLine->HasSwitch(client::switches::kStartupPath)) {
244+
wcscpy(szInitialUrl, cmdLine->GetSwitchValue(client::switches::kStartupPath).c_str());
245245
}
246246
else {
247247
// If the shift key is not pressed, look for the index.html file

appshell/client_switches.cpp renamed to appshell/common/client_switches.cc

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,39 @@
1-
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
1+
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
22
// reserved. Use of this source code is governed by a BSD-style license that
33
// can be found in the LICENSE file.
44

5-
// This file is shared by cefclient and cef_unittests so don't include using
6-
// a qualified path.
7-
#include "client_switches.h" // NOLINT(build/include)
5+
#include "appshell/common/client_switches.h"
6+
7+
namespace client {
8+
namespace switches {
89

9-
namespace cefclient {
10-
1110
const char kStartupPath[] = "startup-path";
1211

13-
// CefSettings attributes.
12+
// CEF and Chromium support a wide range of command-line switches. This file
13+
// only contains command-line switches specific to the cefclient application.
14+
// View CEF/Chromium documentation or search for *_switches.cc files in the
15+
// Chromium source code to identify other existing command-line switches.
16+
// Below is a partial listing of relevant *_switches.cc files:
17+
// base/base_switches.cc
18+
// cef/libcef/common/cef_switches.cc
19+
// chrome/common/chrome_switches.cc (not all apply)
20+
// content/public/common/content_switches.cc
21+
1422
const char kMultiThreadedMessageLoop[] = "multi-threaded-message-loop";
1523
const char kCachePath[] = "cache-path";
24+
const char kUrl[] = "url";
25+
const char kOffScreenRenderingEnabled[] = "off-screen-rendering-enabled";
26+
const char kOffScreenFrameRate[] = "off-screen-frame-rate";
27+
const char kTransparentPaintingEnabled[] = "transparent-painting-enabled";
28+
const char kShowUpdateRect[] = "show-update-rect";
29+
const char kMouseCursorChangeDisabled[] = "mouse-cursor-change-disabled";
30+
const char kRequestContextPerBrowser[] = "request-context-per-browser";
31+
const char kRequestContextSharedCache[] = "request-context-shared-cache";
32+
const char kBackgroundColor[] = "background-color";
33+
const char kEnableGPU[] = "enable-gpu";
34+
const char kFilterURL[] = "filter-url";
35+
36+
// CefSettings attributes.
1637
const char kLogFile[] = "log-file";
1738
const char kLogSeverity[] = "log-severity";
1839
const char kLogSeverity_Verbose[] = "verbose";
@@ -79,4 +100,5 @@ const char kAcceleratedPluginsDisabled[] = "accelerated-plugins-disabled";
79100
const char kDeveloperToolsDisabled[] = "developer-tools-disabled";
80101
const char kFullscreenEnabled[] = "fullscreen-enabled";
81102

82-
} // namespace cefclient
103+
} // namespace switches
104+
} // namespace client

appshell/client_switches.h renamed to appshell/common/client_switches.h

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
1-
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
1+
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
22
// reserved. Use of this source code is governed by a BSD-style license that
33
// can be found in the LICENSE file.
44

55
// Defines all of the command line switches used by cefclient.
66

7-
#ifndef CEF_TESTS_CEFCLIENT_CEFCLIENT_SWITCHES_H_
8-
#define CEF_TESTS_CEFCLIENT_CEFCLIENT_SWITCHES_H_
7+
#ifndef CEF_TESTS_CEFCLIENT_CEFCLIENT_COMMON_SWITCHES_H_
8+
#define CEF_TESTS_CEFCLIENT_CEFCLIENT_COMMON_SWITCHES_H_
99
#pragma once
1010

11-
namespace cefclient {
11+
namespace client {
12+
namespace switches {
1213

1314
extern const char kStartupPath[];
1415

15-
// CefSettings attributes.
1616
extern const char kMultiThreadedMessageLoop[];
1717
extern const char kCachePath[];
18+
extern const char kUrl[];
19+
extern const char kOffScreenRenderingEnabled[];
20+
extern const char kOffScreenFrameRate[];
21+
extern const char kTransparentPaintingEnabled[];
22+
extern const char kShowUpdateRect[];
23+
extern const char kMouseCursorChangeDisabled[];
24+
extern const char kRequestContextPerBrowser[];
25+
extern const char kRequestContextSharedCache[];
26+
extern const char kBackgroundColor[];
27+
extern const char kEnableGPU[];
28+
extern const char kFilterURL[];
29+
30+
// CefSettings attributes.
1831
extern const char kLogFile[];
1932
extern const char kLogSeverity[];
2033
extern const char kLogSeverity_Verbose[];
@@ -75,6 +88,7 @@ extern const char kAcceleratedPluginsDisabled[];
7588
extern const char kDeveloperToolsDisabled[];
7689
extern const char kFullscreenEnabled[];
7790

78-
} // namespace cefclient
91+
} // namespace switches
92+
} // namespace client
7993

80-
#endif // CEF_TESTS_CEFCLIENT_CEFCLIENT_SWITCHES_H_
94+
#endif // CEF_TESTS_CEFCLIENT_CEFCLIENT_COMMON_SWITCHES_H_

appshell_paths.gypi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@
156156
'appshell/client_app_delegates.cpp',
157157
'appshell/client_handler.cpp',
158158
'appshell/client_handler.h',
159-
'appshell/client_switches.cpp',
160-
'appshell/client_switches.h',
159+
'appshell/common/client_switches.cc',
160+
'appshell/common/client_switches.h',
161161
'appshell/native_menu_model.cpp',
162162
'appshell/native_menu_model.h',
163163
'appshell/resource_util.h',
@@ -264,8 +264,8 @@
264264
'appshell/client_handler.cpp',
265265
'appshell/client_handler.h',
266266
'appshell/client_handler_mac.mm',
267-
'appshell/client_switches.cpp',
268-
'appshell/client_switches.h',
267+
'appshell/common/client_switches.cc',
268+
'appshell/common/client_switches.h',
269269
'appshell/native_menu_model.cpp',
270270
'appshell/native_menu_model.h',
271271
'appshell/process_helper_mac.cpp',

0 commit comments

Comments
 (0)