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

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 commit for cross process navigation. 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 e6f2b7930a104bc970ae10fca7cba12ca1f01d95..3c193adb3e57ea91d03e907013adbb4ed9edc46d 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -70,6 +70,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();
@@ -155,6 +158,16 @@ 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_->CommitIfCurrent(INSTANT_COMMIT_NAVIGATED))
sky 2012/12/10 14:47:30 Style guide says you want one of the following her
Shishir 2012/12/10 18:35:52 Done.
+ return preview->GetDelegate()->OpenURLFromTab(source, params);
+ else
+ return NULL;
+}
+
void InstantLoader::WebContentsDelegateImpl::MaybeCommitFromPointerRelease() {
if (loader_->is_pointer_down_from_activate_) {
loader_->is_pointer_down_from_activate_ = false;
@@ -295,6 +308,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) {
« 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