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

Unified Diff: chrome/browser/ui/search/search_tab_helper.h

Issue 10827055: Move web_contents from SearchViewController to SearchTabHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/ui/search/search_tab_helper.h
diff --git a/chrome/browser/ui/search/search_tab_helper.h b/chrome/browser/ui/search/search_tab_helper.h
index e1a30716b2431953b73a46acc119b307a26f667f..c88bfd7d22033557794a30bd7a6350304ea4a4c8 100644
--- a/chrome/browser/ui/search/search_tab_helper.h
+++ b/chrome/browser/ui/search/search_tab_helper.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/search/search_model.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
@@ -14,11 +15,13 @@
class OmniboxEditModel;
class TabContents;
+namespace content {
+class WebContents;
+};
+
namespace chrome {
namespace search {
-class SearchModel;
-
// Per-tab search "helper". Acts as the owner and controller of the tab's
// search UI model.
class SearchTabHelper : public content::WebContentsObserver,
@@ -27,10 +30,13 @@ class SearchTabHelper : public content::WebContentsObserver,
SearchTabHelper(TabContents* contents, bool is_search_enabled);
virtual ~SearchTabHelper();
- SearchModel* model() const {
- return model_.get();
+ SearchModel* model() {
+ return &model_;
}
+ // Lazily create web contents for NTP.
sky 2012/07/28 02:27:53 Document ownership.
dhollowa 2012/07/31 17:03:46 Done.
+ content::WebContents* GetNTPWebContents();
+
// Invoked when the OmniboxEditModel changes state in some way that might
// affect the search mode.
void OmniboxEditModelChanged(OmniboxEditModel* edit_model);
@@ -52,7 +58,10 @@ class SearchTabHelper : public content::WebContentsObserver,
const bool is_search_enabled_;
// Model object for UI that cares about search state.
- scoped_ptr<SearchModel> model_;
+ SearchModel model_;
+
+ // Lazily created web contents for NTP.
+ scoped_ptr<content::WebContents> ntp_web_contents_;
content::NotificationRegistrar registrar_;
« no previous file with comments | « no previous file | chrome/browser/ui/search/search_tab_helper.cc » ('j') | chrome/browser/ui/search/search_tab_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698