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

Unified Diff: chrome/browser/instant/instant_loader.cc

Issue 11416187: Commit instant loader when the instant page navigates away from instant URL. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing issue caused due to removal of TabContents. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/instant/instant_loader.h ('k') | chrome/browser/instant/instant_tab.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/instant/instant_loader.h ('k') | chrome/browser/instant/instant_tab.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698