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

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

Issue 1473423002: Provide default implementation for WebContentsDelegate::OpenURLFromTab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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.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/location.h" 9 #include "base/location.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 devtools_frontend_->Close(); 259 devtools_frontend_->Close();
260 devtools_frontend_ = NULL; 260 devtools_frontend_ = NULL;
261 } 261 }
262 262
263 gfx::NativeView Shell::GetContentView() { 263 gfx::NativeView Shell::GetContentView() {
264 if (!web_contents_) 264 if (!web_contents_)
265 return NULL; 265 return NULL;
266 return web_contents_->GetNativeView(); 266 return web_contents_->GetNativeView();
267 } 267 }
268 268
269 WebContents* Shell::OpenURLFromTab(WebContents* source,
270 const OpenURLParams& params) {
271 // CURRENT_TAB is the only one we implement for now.
272 if (params.disposition != CURRENT_TAB)
273 return NULL;
274 NavigationController::LoadURLParams load_url_params(params.url);
275 load_url_params.source_site_instance = params.source_site_instance;
276 load_url_params.referrer = params.referrer;
277 load_url_params.frame_tree_node_id = params.frame_tree_node_id;
278 load_url_params.transition_type = params.transition;
279 load_url_params.extra_headers = params.extra_headers;
280 load_url_params.should_replace_current_entry =
281 params.should_replace_current_entry;
282
283 if (params.transferred_global_request_id != GlobalRequestID()) {
284 load_url_params.is_renderer_initiated = params.is_renderer_initiated;
285 load_url_params.transferred_global_request_id =
286 params.transferred_global_request_id;
287 } else if (params.is_renderer_initiated) {
288 load_url_params.is_renderer_initiated = true;
289 }
290
291 source->GetController().LoadURLWithParams(load_url_params);
292 return source;
293 }
294
295 void Shell::LoadingStateChanged(WebContents* source, 269 void Shell::LoadingStateChanged(WebContents* source,
296 bool to_different_document) { 270 bool to_different_document) {
297 UpdateNavigationControls(to_different_document); 271 UpdateNavigationControls(to_different_document);
298 PlatformSetIsLoading(source->IsLoading()); 272 PlatformSetIsLoading(source->IsLoading());
299 } 273 }
300 274
301 void Shell::EnterFullscreenModeForTab(WebContents* web_contents, 275 void Shell::EnterFullscreenModeForTab(WebContents* web_contents,
302 const GURL& origin) { 276 const GURL& origin) {
303 ToggleFullscreenModeForTab(web_contents, true); 277 ToggleFullscreenModeForTab(web_contents, true);
304 } 278 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 devtools_frontend_->Activate(); 416 devtools_frontend_->Activate();
443 devtools_frontend_->Focus(); 417 devtools_frontend_->Focus();
444 } 418 }
445 419
446 void Shell::OnDevToolsWebContentsDestroyed() { 420 void Shell::OnDevToolsWebContentsDestroyed() {
447 devtools_observer_.reset(); 421 devtools_observer_.reset();
448 devtools_frontend_ = NULL; 422 devtools_frontend_ = NULL;
449 } 423 }
450 424
451 } // namespace content 425 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698