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

Side by Side Diff: content/shell/shell_browser_main_parts.cc

Issue 9982011: Mac content shell: Fix new browser window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « content/shell/shell_browser_main_parts.h ('k') | content/shell/shell_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell_browser_main_parts.h" 5 #include "content/shell/shell_browser_main_parts.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 MessageLoop* ShellBrowserMainParts::GetMainMessageLoop() { 52 MessageLoop* ShellBrowserMainParts::GetMainMessageLoop() {
53 return NULL; 53 return NULL;
54 } 54 }
55 55
56 int ShellBrowserMainParts::PreCreateThreads() { 56 int ShellBrowserMainParts::PreCreateThreads() {
57 return 0; 57 return 0;
58 } 58 }
59 59
60 void ShellBrowserMainParts::PreMainMessageLoopRun() { 60 void ShellBrowserMainParts::PreMainMessageLoopRun() {
61 browser_context_.reset(new ShellBrowserContext(this));
62
61 Shell::PlatformInitialize(); 63 Shell::PlatformInitialize();
62 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); 64 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider);
63 65
64 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 66 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
65 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { 67 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
66 std::string port_str = 68 std::string port_str =
67 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); 69 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort);
68 int port; 70 int port;
69 if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { 71 if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) {
70 devtools_delegate_ = new ShellDevToolsDelegate( 72 devtools_delegate_ = new ShellDevToolsDelegate(
71 port, 73 port,
72 ShellBrowserContext::GetInstance()->GetRequestContext()); 74 browser_context_->GetRequestContext());
73 } else { 75 } else {
74 DLOG(WARNING) << "Invalid http debugger port number " << port; 76 DLOG(WARNING) << "Invalid http debugger port number " << port;
75 } 77 }
76 } 78 }
77 79
78 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { 80 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
79 Shell::CreateNewWindow(ShellBrowserContext::GetInstance(), 81 Shell::CreateNewWindow(browser_context_.get(),
80 GetStartupURL(), 82 GetStartupURL(),
81 NULL, 83 NULL,
82 MSG_ROUTING_NONE, 84 MSG_ROUTING_NONE,
83 NULL); 85 NULL);
84 } 86 }
85 } 87 }
86 88
87 void ShellBrowserMainParts::PostMainMessageLoopRun() { 89 void ShellBrowserMainParts::PostMainMessageLoopRun() {
88 if (devtools_delegate_) 90 if (devtools_delegate_)
89 devtools_delegate_->Stop(); 91 devtools_delegate_->Stop();
92 browser_context_.reset();
90 } 93 }
91 94
92 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { 95 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) {
93 return false; 96 return false;
94 } 97 }
95 98
96 ui::Clipboard* ShellBrowserMainParts::GetClipboard() { 99 ui::Clipboard* ShellBrowserMainParts::GetClipboard() {
97 if (!clipboard_.get()) 100 if (!clipboard_.get())
98 clipboard_.reset(new ui::Clipboard()); 101 clipboard_.reset(new ui::Clipboard());
99 return clipboard_.get(); 102 return clipboard_.get();
100 } 103 }
101 104
102 } // namespace 105 } // namespace
OLDNEW
« no previous file with comments | « content/shell/shell_browser_main_parts.h ('k') | content/shell/shell_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698