OLD | NEW |
---|---|
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 #include "webkit/glue/window_open_disposition.h" | |
sreeram
2013/01/22 06:01:19
You don't need this include (it's already being in
dougw
2013/01/24 03:05:25
Done.
| |
24 | |
23 | 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 int kUserDataKey; | 28 int kUserDataKey; |
27 | 29 |
28 class InstantLoaderUserData : public base::SupportsUserData::Data { | 30 class InstantLoaderUserData : public base::SupportsUserData::Data { |
29 public: | 31 public: |
30 explicit InstantLoaderUserData(InstantLoader* loader) : loader_(loader) {} | 32 explicit InstantLoaderUserData(InstantLoader* loader) : loader_(loader) {} |
31 | 33 |
32 InstantLoader* loader() const { return loader_; } | 34 InstantLoader* loader() const { return loader_; } |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 | 311 |
310 void InstantLoader::RenderViewGone() { | 312 void InstantLoader::RenderViewGone() { |
311 controller_->InstantLoaderRenderViewGone(); | 313 controller_->InstantLoaderRenderViewGone(); |
312 } | 314 } |
313 | 315 |
314 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) { | 316 void InstantLoader::AboutToNavigateMainFrame(const GURL& url) { |
315 controller_->InstantLoaderAboutToNavigateMainFrame(url); | 317 controller_->InstantLoaderAboutToNavigateMainFrame(url); |
316 } | 318 } |
317 | 319 |
318 void InstantLoader::NavigateToURL(const GURL& url, | 320 void InstantLoader::NavigateToURL(const GURL& url, |
319 content::PageTransition transition) { | 321 content::PageTransition transition, |
322 WindowOpenDisposition disposition) { | |
320 InstantSupportDetermined(true); | 323 InstantSupportDetermined(true); |
321 controller_->NavigateToURL(url, transition); | 324 controller_->NavigateToURL(url, transition, disposition); |
322 } | 325 } |
323 | 326 |
324 void InstantLoader::Observe(int type, | 327 void InstantLoader::Observe(int type, |
325 const content::NotificationSource& source, | 328 const content::NotificationSource& source, |
326 const content::NotificationDetails& details) { | 329 const content::NotificationDetails& details) { |
327 #if defined(OS_MACOSX) | 330 #if defined(OS_MACOSX) |
328 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { | 331 if (type == content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED) { |
329 if (content::RenderWidgetHostView* rwhv = | 332 if (content::RenderWidgetHostView* rwhv = |
330 contents_->GetRenderWidgetHostView()) | 333 contents_->GetRenderWidgetHostView()) |
331 rwhv->SetTakesFocusOnlyOnMouseDown(true); | 334 rwhv->SetTakesFocusOnlyOnMouseDown(true); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
408 content::WebContents* new_contents) { | 411 content::WebContents* new_contents) { |
409 DCHECK_EQ(old_contents, contents()); | 412 DCHECK_EQ(old_contents, contents()); |
410 CleanupPreviewContents(); | 413 CleanupPreviewContents(); |
411 // We release here without deleting so that the caller still has the | 414 // We release here without deleting so that the caller still has the |
412 // responsibility for deleting the WebContents. | 415 // responsibility for deleting the WebContents. |
413 ignore_result(contents_.release()); | 416 ignore_result(contents_.release()); |
414 contents_.reset(new_contents); | 417 contents_.reset(new_contents); |
415 SetupPreviewContents(); | 418 SetupPreviewContents(); |
416 controller_->SwappedWebContents(); | 419 controller_->SwappedWebContents(); |
417 } | 420 } |
OLD | NEW |