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

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 7 years, 11 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
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/search/search_tab_helper.h" 14 #include "chrome/browser/ui/search/search_tab_helper.h"
15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
16 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 16 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
17 #include "content/public/browser/notification_source.h" 17 #include "content/public/browser/notification_source.h"
18 #include "content/public/browser/notification_types.h" 18 #include "content/public/browser/notification_types.h"
19 #include "content/public/browser/render_widget_host_view.h" 19 #include "content/public/browser/render_widget_host_view.h"
20 #include "content/public/browser/web_contents_delegate.h" 20 #include "content/public/browser/web_contents_delegate.h"
21 #include "content/public/browser/web_contents_view.h" 21 #include "content/public/browser/web_contents_view.h"
22 #include "ipc/ipc_message.h" 22 #include "ipc/ipc_message.h"
23 23
24
sreeram 2013/01/24 19:13:48 Delete this extra blank line.
dougw 2013/02/06 21:42:11 Done.
24 namespace { 25 namespace {
25 26
26 int kUserDataKey; 27 int kUserDataKey;
27 28
28 class InstantLoaderUserData : public base::SupportsUserData::Data { 29 class InstantLoaderUserData : public base::SupportsUserData::Data {
29 public: 30 public:
30 explicit InstantLoaderUserData(InstantLoader* loader) : loader_(loader) {} 31 explicit InstantLoaderUserData(InstantLoader* loader) : loader_(loader) {}
31 32
32 InstantLoader* loader() const { return loader_; } 33 InstantLoader* loader() const { return loader_; }
33 34
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 310
310 void InstantLoader::RenderViewGone() { 311 void InstantLoader::RenderViewGone() {
311 controller_->InstantLoaderRenderViewGone(); 312 controller_->InstantLoaderRenderViewGone();
312 } 313 }
313 314
314 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) { 315 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) {
315 controller_->InstantLoaderAboutToNavigateMainFrame(url); 316 controller_->InstantLoaderAboutToNavigateMainFrame(url);
316 } 317 }
317 318
318 void InstantLoader::NavigateToURL(const GURL& url, 319 void InstantLoader::NavigateToURL(const GURL& url,
319 content::PageTransition transition) { 320 content::PageTransition transition,
321 WindowOpenDisposition disposition) {
320 InstantSupportDetermined(true); 322 InstantSupportDetermined(true);
321 controller_->NavigateToURL(url, transition); 323 controller_->NavigateToURL(url, transition, disposition);
322 } 324 }
323 325
324 void InstantLoader::Observe(int type, 326 void InstantLoader::Observe(int type,
325 const content::NotificationSource& source, 327 const content::NotificationSource& source,
326 const content::NotificationDetails& details) { 328 const content::NotificationDetails& details) {
327 #if defined(OS_MACOSX) 329 #if defined(OS_MACOSX)
328 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { 330 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) {
329 if (content::RenderWidgetHostView* rwhv = 331 if (content::RenderWidgetHostView* rwhv =
330 contents_->GetRenderWidgetHostView()) 332 contents_->GetRenderWidgetHostView())
331 rwhv->SetTakesFocusOnlyOnMouseDown(true); 333 rwhv->SetTakesFocusOnlyOnMouseDown(true);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 content::WebContents* new_contents) { 410 content::WebContents* new_contents) {
409 DCHECK_EQ(old_contents, contents()); 411 DCHECK_EQ(old_contents, contents());
410 CleanupPreviewContents(); 412 CleanupPreviewContents();
411 // We release here without deleting so that the caller still has the 413 // We release here without deleting so that the caller still has the
412 // responsibility for deleting the WebContents. 414 // responsibility for deleting the WebContents.
413 ignore_result(contents_.release()); 415 ignore_result(contents_.release());
414 contents_.reset(new_contents); 416 contents_.reset(new_contents);
415 SetupPreviewContents(); 417 SetupPreviewContents();
416 controller_->SwappedWebContents(); 418 controller_->SwappedWebContents();
417 } 419 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698