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

Unified Diff: chrome/browser/ui/search/search_model.cc

Issue 10944016: Switch SearchTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/ui/search/search_model.cc
diff --git a/chrome/browser/ui/search/search_model.cc b/chrome/browser/ui/search/search_model.cc
index c8582a8d0b4875f141925be7cddd32f23f21e0a4..9fb8bdc7cbf170edcbcf6a96b6891a65da5ba312 100644
--- a/chrome/browser/ui/search/search_model.cc
+++ b/chrome/browser/ui/search/search_model.cc
@@ -4,25 +4,28 @@
#include "chrome/browser/ui/search/search_model.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/search/search.h"
#include "chrome/browser/ui/search/search_model_observer.h"
-#include "chrome/browser/ui/tab_contents/tab_contents.h"
+#include "content/public/browser/web_contents.h"
namespace chrome {
namespace search {
-SearchModel::SearchModel(TabContents* contents)
- : contents_(contents) {
+SearchModel::SearchModel(content::WebContents* web_contents)
+ : web_contents_(web_contents) {
}
SearchModel::~SearchModel() {
}
void SearchModel::SetMode(const Mode& new_mode) {
- if (!contents_)
+ if (!web_contents_)
return;
- DCHECK(IsInstantExtendedAPIEnabled(contents_->profile()))
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents_->GetBrowserContext());
+ DCHECK(IsInstantExtendedAPIEnabled(profile))
<< "Please do not try to set the SearchModel mode without first "
<< "checking if Search is enabled.";

Powered by Google App Engine
This is Rietveld 408576698