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

Unified Diff: chrome/browser/ui/views/search_view_controller.cc

Issue 10827055: Move web_contents from SearchViewController to SearchTabHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Lifetime Created 8 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/search_view_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/search_view_controller.cc
diff --git a/chrome/browser/ui/views/search_view_controller.cc b/chrome/browser/ui/views/search_view_controller.cc
index 4551032b5e29133c51b41d59b8c36fb539269698..21aac0f61800da235ca8672bf8a4934082b6cb92 100644
--- a/chrome/browser/ui/views/search_view_controller.cc
+++ b/chrome/browser/ui/views/search_view_controller.cc
@@ -340,6 +340,7 @@ void SearchViewController::UpdateState() {
break;
}
SetState(new_state);
+ MaybeLoadNTP();
}
void SearchViewController::SetState(State state) {
@@ -457,6 +458,9 @@ void SearchViewController::DestroyViews() {
omnibox_popup_view_parent_->parent()->RemoveChildView(
omnibox_popup_view_parent_);
+ if (content_view_)
+ content_view_->SetWebContents(NULL);
+
contents_container_->SetOverlay(NULL);
delete search_container_;
search_container_ = NULL;
@@ -476,6 +480,14 @@ void SearchViewController::PopupVisibilityChanged() {
}
}
+void SearchViewController::MaybeLoadNTP() {
+ if (state_ != STATE_NTP || !content_view_)
+ return;
+
+ content_view_->SetWebContents(
+ tab_contents_->search_tab_helper()->GetNTPWebContents());
+}
+
chrome::search::SearchModel* SearchViewController::search_model() {
return tab_contents_ ? tab_contents_->search_tab_helper()->model() : NULL;
}
« no previous file with comments | « chrome/browser/ui/views/search_view_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698