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

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

Issue 10978016: Remove two functions on WebContentsDelegate which didn't belong in content. They were only called f… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits and fixed prerender browser tests Created 8 years, 3 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
===================================================================
--- chrome/browser/prerender/prerender_contents.cc (revision 158566)
+++ chrome/browser/prerender/prerender_contents.cc (working copy)
@@ -104,13 +104,6 @@
return NULL;
}
- virtual bool ShouldAddNavigationToHistory(
- const history::HistoryAddPageArgs& add_page_args,
- content::NavigationType navigation_type) OVERRIDE {
- add_page_vector_.push_back(add_page_args);
- return false;
- }
-
virtual bool CanDownload(RenderViewHost* render_view_host,
int request_id,
const std::string& request_method) OVERRIDE {
@@ -170,19 +163,7 @@
prerender_contents_->Destroy(FINAL_STATUS_REGISTER_PROTOCOL_HANDLER);
}
- // Commits the History of Pages to the given TabContents.
- void CommitHistory(TabContents* tab) {
- for (size_t i = 0; i < add_page_vector_.size(); ++i)
- tab->history_tab_helper()->UpdateHistoryForNavigation(
- add_page_vector_[i]);
- }
-
private:
- typedef std::vector<history::HistoryAddPageArgs> AddPageVector;
-
- // Caches pages to be added to the history.
- AddPageVector add_page_vector_;
-
PrerenderContents* prerender_contents_;
};
@@ -697,9 +678,14 @@
return prerender_contents_->web_contents()->GetRenderViewHost();
}
+void PrerenderContents::DidNavigate(
+ const history::HistoryAddPageArgs& add_page_args) {
+ add_page_vector_.push_back(add_page_args);
+}
+
void PrerenderContents::CommitHistory(TabContents* tab) {
- if (tab_contents_delegate_.get())
- tab_contents_delegate_->CommitHistory(tab);
+ for (size_t i = 0; i < add_page_vector_.size(); ++i)
+ tab->history_tab_helper()->UpdateHistoryForNavigation(add_page_vector_[i]);
}
Value* PrerenderContents::GetAsValue() const {

Powered by Google App Engine
This is Rietveld 408576698