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

Side by Side Diff: content/shell/browser/shell_browser_main_parts.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/browser/shell_browser_main_parts.h" 5 #include "content/shell/browser/shell_browser_main_parts.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 29 matching lines...) Expand all
40 #endif 40 #endif
41 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX) 41 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX)
42 #include "ui/base/ime/input_method_initializer.h" 42 #include "ui/base/ime/input_method_initializer.h"
43 #endif 43 #endif
44 44
45 namespace content { 45 namespace content {
46 46
47 namespace { 47 namespace {
48 48
49 GURL GetStartupURL() { 49 GURL GetStartupURL() {
50 CommandLine* command_line = CommandLine::ForCurrentProcess(); 50 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
51 if (command_line->HasSwitch(switches::kContentBrowserTest)) 51 if (command_line->HasSwitch(switches::kContentBrowserTest))
52 return GURL(); 52 return GURL();
53 const CommandLine::StringVector& args = command_line->GetArgs(); 53 const base::CommandLine::StringVector& args = command_line->GetArgs();
54 54
55 #if defined(OS_ANDROID) 55 #if defined(OS_ANDROID)
56 // Delay renderer creation on Android until surface is ready. 56 // Delay renderer creation on Android until surface is ready.
57 return GURL(); 57 return GURL();
58 #endif 58 #endif
59 59
60 if (args.empty()) 60 if (args.empty())
61 return GURL("http://www.google.com/"); 61 return GURL("http://www.google.com/");
62 62
63 GURL url(args[0]); 63 GURL url(args[0]);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 void ShellBrowserMainParts::InitializeMessageLoopContext() { 123 void ShellBrowserMainParts::InitializeMessageLoopContext() {
124 Shell::CreateNewWindow(browser_context_.get(), 124 Shell::CreateNewWindow(browser_context_.get(),
125 GetStartupURL(), 125 GetStartupURL(),
126 NULL, 126 NULL,
127 gfx::Size()); 127 gfx::Size());
128 } 128 }
129 129
130 void ShellBrowserMainParts::PreMainMessageLoopRun() { 130 void ShellBrowserMainParts::PreMainMessageLoopRun() {
131 #if defined(OS_ANDROID) 131 #if defined(OS_ANDROID)
132 if (CommandLine::ForCurrentProcess()->HasSwitch( 132 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
133 switches::kEnableCrashReporter)) { 133 switches::kEnableCrashReporter)) {
134 base::FilePath crash_dumps_dir = 134 base::FilePath crash_dumps_dir =
135 CommandLine::ForCurrentProcess()->GetSwitchValuePath( 135 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
136 switches::kCrashDumpsDir); 136 switches::kCrashDumpsDir);
137 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir)); 137 crash_dump_manager_.reset(new breakpad::CrashDumpManager(crash_dumps_dir));
138 } 138 }
139 #endif 139 #endif
140 140
141 net_log_.reset(new ShellNetLog("content_shell")); 141 net_log_.reset(new ShellNetLog("content_shell"));
142 InitializeBrowserContexts(); 142 InitializeBrowserContexts();
143 Shell::Initialize(); 143 Shell::Initialize();
144 net::NetModule::SetResourceProvider(PlatformResourceProvider); 144 net::NetModule::SetResourceProvider(PlatformResourceProvider);
145 145
(...skipping 13 matching lines...) Expand all
159 return !run_message_loop_; 159 return !run_message_loop_;
160 } 160 }
161 161
162 void ShellBrowserMainParts::PostMainMessageLoopRun() { 162 void ShellBrowserMainParts::PostMainMessageLoopRun() {
163 devtools_http_handler_.reset(); 163 devtools_http_handler_.reset();
164 browser_context_.reset(); 164 browser_context_.reset();
165 off_the_record_browser_context_.reset(); 165 off_the_record_browser_context_.reset();
166 } 166 }
167 167
168 } // namespace 168 } // namespace
OLDNEW
« no previous file with comments | « content/shell/browser/shell_browser_context.cc ('k') | content/shell/browser/shell_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698