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

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

Issue 790423002: Add the main frame routing ID to WebContentsDelegate, use it in BackgroundContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content shell 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
« no previous file with comments | « content/shell/browser/shell.h ('k') | content/shell/browser/shell_application_mac.mm » ('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 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.h" 5 #include "content/shell/browser/shell.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 gfx::Size Shell::AdjustWindowSize(const gfx::Size& initial_size) { 148 gfx::Size Shell::AdjustWindowSize(const gfx::Size& initial_size) {
149 if (!initial_size.IsEmpty()) 149 if (!initial_size.IsEmpty())
150 return initial_size; 150 return initial_size;
151 return gfx::Size(kDefaultTestWindowWidthDip, kDefaultTestWindowHeightDip); 151 return gfx::Size(kDefaultTestWindowWidthDip, kDefaultTestWindowHeightDip);
152 } 152 }
153 153
154 Shell* Shell::CreateNewWindow(BrowserContext* browser_context, 154 Shell* Shell::CreateNewWindow(BrowserContext* browser_context,
155 const GURL& url, 155 const GURL& url,
156 SiteInstance* site_instance, 156 SiteInstance* site_instance,
157 int routing_id,
158 const gfx::Size& initial_size) { 157 const gfx::Size& initial_size) {
159 WebContents::CreateParams create_params(browser_context, site_instance); 158 WebContents::CreateParams create_params(browser_context, site_instance);
160 create_params.routing_id = routing_id;
161 create_params.initial_size = AdjustWindowSize(initial_size); 159 create_params.initial_size = AdjustWindowSize(initial_size);
162 WebContents* web_contents = WebContents::Create(create_params); 160 WebContents* web_contents = WebContents::Create(create_params);
163 Shell* shell = CreateShell(web_contents, create_params.initial_size); 161 Shell* shell = CreateShell(web_contents, create_params.initial_size);
164 if (!url.is_empty()) 162 if (!url.is_empty())
165 shell->LoadURL(url); 163 shell->LoadURL(url);
166 return shell; 164 return shell;
167 } 165 }
168 166
169 void Shell::LoadURL(const GURL& url) { 167 void Shell::LoadURL(const GURL& url) {
170 LoadURLForFrame(url, std::string()); 168 LoadURLForFrame(url, std::string());
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 devtools_frontend_->Activate(); 398 devtools_frontend_->Activate();
401 devtools_frontend_->Focus(); 399 devtools_frontend_->Focus();
402 } 400 }
403 401
404 void Shell::OnDevToolsWebContentsDestroyed() { 402 void Shell::OnDevToolsWebContentsDestroyed() {
405 devtools_observer_.reset(); 403 devtools_observer_.reset();
406 devtools_frontend_ = NULL; 404 devtools_frontend_ = NULL;
407 } 405 }
408 406
409 } // namespace content 407 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell.h ('k') | content/shell/browser/shell_application_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698