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

Side by Side Diff: chrome/browser/instant/instant_loader.cc

Issue 11644009: Added support for passing WindowOpenDisposition into BrowserInstantController::OpenURL() from the o… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/instant/instant_loader.h" 5 #include "chrome/browser/instant/instant_loader.h"
6 6
7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
9 #include "chrome/browser/favicon/favicon_tab_helper.h" 9 #include "chrome/browser/favicon/favicon_tab_helper.h"
10 #include "chrome/browser/history/history_tab_helper.h" 10 #include "chrome/browser/history/history_tab_helper.h"
11 #include "chrome/browser/instant/instant_controller.h" 11 #include "chrome/browser/instant/instant_controller.h"
12 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" 12 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h"
13 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" 13 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
14 #include "chrome/browser/ui/constrained_window_tab_helper.h" 14 #include "chrome/browser/ui/constrained_window_tab_helper.h"
15 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" 15 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h"
16 #include "chrome/browser/ui/search/search_tab_helper.h" 16 #include "chrome/browser/ui/search/search_tab_helper.h"
17 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 17 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
18 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 18 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
19 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
20 #include "content/public/browser/notification_types.h" 20 #include "content/public/browser/notification_types.h"
21 #include "content/public/browser/render_widget_host_view.h" 21 #include "content/public/browser/render_widget_host_view.h"
22 #include "content/public/browser/web_contents_delegate.h" 22 #include "content/public/browser/web_contents_delegate.h"
23 #include "ipc/ipc_message.h" 23 #include "ipc/ipc_message.h"
24 #include "webkit/glue/window_open_disposition.h"
25
24 26
25 namespace { 27 namespace {
26 28
27 int kUserDataKey; 29 int kUserDataKey;
28 30
29 class InstantLoaderUserData : public base::SupportsUserData::Data { 31 class InstantLoaderUserData : public base::SupportsUserData::Data {
30 public: 32 public:
31 explicit InstantLoaderUserData(InstantLoader* loader) : loader_(loader) {} 33 explicit InstantLoaderUserData(InstantLoader* loader) : loader_(loader) {}
32 34
33 InstantLoader* loader() const { return loader_; } 35 InstantLoader* loader() const { return loader_; }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 322
321 void InstantLoader::RenderViewGone() { 323 void InstantLoader::RenderViewGone() {
322 controller_->InstantLoaderRenderViewGone(); 324 controller_->InstantLoaderRenderViewGone();
323 } 325 }
324 326
325 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) { 327 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) {
326 controller_->InstantLoaderAboutToNavigateMainFrame(url); 328 controller_->InstantLoaderAboutToNavigateMainFrame(url);
327 } 329 }
328 330
329 void InstantLoader::NavigateToURL(const GURL& url, 331 void InstantLoader::NavigateToURL(const GURL& url,
330 content::PageTransition transition) { 332 content::PageTransition transition,
333 WindowOpenDisposition disposition) {
331 InstantSupportDetermined(true); 334 InstantSupportDetermined(true);
332 controller_->NavigateToURL(url, transition); 335 controller_->NavigateToURL(url, transition, disposition);
333 } 336 }
334 337
335 void InstantLoader::Observe(int type, 338 void InstantLoader::Observe(int type,
336 const content::NotificationSource& source, 339 const content::NotificationSource& source,
337 const content::NotificationDetails& details) { 340 const content::NotificationDetails& details) {
338 #if defined(OS_MACOSX) 341 #if defined(OS_MACOSX)
339 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { 342 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) {
340 if (content::RenderWidgetHostView* rwhv = 343 if (content::RenderWidgetHostView* rwhv =
341 contents_->GetRenderWidgetHostView()) 344 contents_->GetRenderWidgetHostView())
342 rwhv->SetTakesFocusOnlyOnMouseDown(true); 345 rwhv->SetTakesFocusOnlyOnMouseDown(true);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 content::WebContents* new_contents) { 430 content::WebContents* new_contents) {
428 DCHECK_EQ(old_contents, contents()); 431 DCHECK_EQ(old_contents, contents());
429 CleanupPreviewContents(); 432 CleanupPreviewContents();
430 // We release here without deleting so that the caller still has the 433 // We release here without deleting so that the caller still has the
431 // responsibility for deleting the WebContents. 434 // responsibility for deleting the WebContents.
432 ignore_result(contents_.release()); 435 ignore_result(contents_.release());
433 contents_.reset(new_contents); 436 contents_.reset(new_contents);
434 SetupPreviewContents(); 437 SetupPreviewContents();
435 controller_->SwappedWebContents(); 438 controller_->SwappedWebContents();
436 } 439 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698