Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1370)

Unified Diff: content/shell/browser/shell.cc

Issue 803813003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/shell.cc
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 0c8f7e246ba3fe6789eb7449dbe144c6b22156af..75256552811e7d44d4a196a296ee5385c13a0cd2 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -84,7 +84,8 @@ Shell::Shell(WebContents* web_contents)
window_(NULL),
url_edit_view_(NULL),
headless_(false) {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDumpRenderTree))
headless_ = true;
windows_.push_back(this);
@@ -125,7 +126,8 @@ Shell* Shell::CreateShell(WebContents* web_contents,
shell->PlatformResizeSubViews();
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpRenderTree)) {
web_contents->GetMutableRendererPrefs()->use_custom_colors = false;
web_contents->GetRenderViewHost()->SyncRendererPrefs();
}
@@ -215,7 +217,8 @@ void Shell::AddNewContents(WebContents* source,
bool user_gesture,
bool* was_blocked) {
CreateShell(new_contents, AdjustWindowSize(initial_pos.size()));
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpRenderTree))
NotifyDoneForwarder::CreateForWebContents(new_contents);
}
@@ -309,7 +312,8 @@ void Shell::ToggleFullscreenModeForTab(WebContents* web_contents,
#if defined(OS_ANDROID)
PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen);
#endif
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpRenderTree))
return;
if (is_fullscreen_ != enter_fullscreen) {
is_fullscreen_ = enter_fullscreen;
@@ -350,7 +354,8 @@ void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) {
JavaScriptDialogManager* Shell::GetJavaScriptDialogManager(
WebContents* source) {
if (!dialog_manager_) {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
dialog_manager_.reset(command_line.HasSwitch(switches::kDumpRenderTree)
? new LayoutTestJavaScriptDialogManager
: new ShellJavaScriptDialogManager);
@@ -363,11 +368,13 @@ bool Shell::AddMessageToConsole(WebContents* source,
const base::string16& message,
int32 line_no,
const base::string16& source_id) {
- return CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree);
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpRenderTree);
}
void Shell::RendererUnresponsive(WebContents* source) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpRenderTree))
return;
WebKitTestController::Get()->RendererUnresponsive();
}
@@ -381,7 +388,8 @@ void Shell::DeactivateContents(WebContents* contents) {
}
void Shell::WorkerCrashed(WebContents* source) {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpRenderTree))
return;
WebKitTestController::Get()->WorkerCrashed();
}
@@ -404,7 +412,7 @@ void Shell::TitleWasSet(NavigationEntry* entry, bool explicit_set) {
void Shell::InnerShowDevTools(const std::string& settings,
const std::string& frontend_url) {
if (!devtools_frontend_) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDumpRenderTree)) {
devtools_frontend_ = LayoutTestDevToolsFrontend::Show(
web_contents(), settings, frontend_url);
« no previous file with comments | « content/shell/browser/layout_test/layout_test_browser_main.cc ('k') | content/shell/browser/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698