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

Unified Diff: chrome/browser/prerender/prerender_contents.cc

Issue 9387015: Upstreaming prerendering changes for Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: More changes Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prerender/prerender_contents.cc
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index c34e542d8def6f0c50186f075184d0c453f3f5a6..77377a48fb0a3d248830bee19e908ac334da0887 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -220,6 +220,7 @@ PrerenderContents::PrerenderContents(
profile_(profile),
page_id_(0),
has_stopped_loading_(false),
+ has_finished_loading_(false),
final_status_(FINAL_STATUS_MAX),
prerendering_has_started_(false),
match_complete_status_(MATCH_COMPLETE_DEFAULT),
@@ -272,6 +273,10 @@ void PrerenderContents::StartPrerendering(
active_browser->active_index());
if (active_web_contents)
active_web_contents->GetView()->GetContainerBounds(&tab_bounds);
+ } else {
+ gfx::Rect default_tab_bounds = prerender_manager_->default_tab_bounds();
dominich 2012/02/14 01:11:20 So you don't need this unless you want to override
Jay Civelli 2012/02/14 03:13:51 Moved to the config, as you suggested later on.
+ if (!default_tab_bounds.IsEmpty())
+ tab_bounds = default_tab_bounds;
}
}
@@ -531,9 +536,17 @@ void PrerenderContents::DidStartProvisionalLoadForFrame(
// case, the spinner would start again in the browser, so we must reset
// has_stopped_loading_ so that the spinner won't be stopped.
has_stopped_loading_ = false;
+ has_finished_loading_ = false;
}
}
+void PrerenderContents::DidFinishLoad(int64 frame_id,
+ const GURL& validated_url,
+ bool is_main_frame) {
+ if (is_main_frame)
+ has_finished_loading_ = true;
+}
+
bool PrerenderContents::ShouldSuppressDialogs() {
// Always suppress JavaScript messages if they're triggered by a page being
// prerendered.

Powered by Google App Engine
This is Rietveld 408576698