| Index: chrome/browser/instant/instant_loader.cc
|
| diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
|
| index 9d08d426a77275a038ad24cd06e36d4e5031ae31..51164970cf377fc58b1900f5f4e7b82b6cd7a2d6 100644
|
| --- a/chrome/browser/instant/instant_loader.cc
|
| +++ b/chrome/browser/instant/instant_loader.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/instant/instant_loader.h"
|
|
|
| #include "chrome/browser/content_settings/tab_specific_content_settings.h"
|
| +#include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
|
| #include "chrome/browser/history/history_tab_helper.h"
|
| #include "chrome/browser/instant/instant_controller.h"
|
| #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h"
|
| @@ -71,6 +72,9 @@ class InstantLoader::WebContentsDelegateImpl
|
| virtual void HandleGestureEnd() OVERRIDE;
|
| virtual void DragEnded() OVERRIDE;
|
| virtual bool OnGoToEntryOffset(int offset) OVERRIDE;
|
| + virtual content::WebContents* OpenURLFromTab(
|
| + content::WebContents* source,
|
| + const content::OpenURLParams& params) OVERRIDE;
|
|
|
| void MaybeCommitFromPointerRelease();
|
|
|
| @@ -156,6 +160,15 @@ bool InstantLoader::WebContentsDelegateImpl::OnGoToEntryOffset(int offset) {
|
| return false;
|
| }
|
|
|
| +content::WebContents* InstantLoader::WebContentsDelegateImpl::OpenURLFromTab(
|
| + content::WebContents* source,
|
| + const content::OpenURLParams& params) {
|
| + content::WebContents* preview = loader_->contents_.get();
|
| + if (loader_->controller_->CommitIfPossible(INSTANT_COMMIT_NAVIGATED))
|
| + return preview->GetDelegate()->OpenURLFromTab(source, params);
|
| + return NULL;
|
| +}
|
| +
|
| void InstantLoader::WebContentsDelegateImpl::MaybeCommitFromPointerRelease() {
|
| if (loader_->is_pointer_down_from_activate_) {
|
| loader_->is_pointer_down_from_activate_ = false;
|
| @@ -297,6 +310,10 @@ void InstantLoader::RenderViewGone() {
|
| controller_->InstantLoaderRenderViewGone();
|
| }
|
|
|
| +void InstantLoader::AboutToNavigateMainFrame(const GURL& url) {
|
| + controller_->InstantLoaderAboutToNavigateMainFrame(url);
|
| +}
|
| +
|
| void InstantLoader::Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| @@ -340,6 +357,9 @@ void InstantLoader::SetupPreviewContents() {
|
| chrome::search::SearchTabHelper::CreateForWebContents(contents());
|
| HistoryTabHelper::CreateForWebContents(contents());
|
|
|
| + // Observers.
|
| + extensions::WebNavigationTabObserver::CreateForWebContents(contents());
|
| +
|
| // And some flat-out paranoia.
|
| safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(contents());
|
|
|
|
|