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

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

Issue 2166023004: Cleanup in InstantTab and InstantController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/instant_tab.cc
diff --git a/chrome/browser/ui/search/instant_tab.cc b/chrome/browser/ui/search/instant_tab.cc
index dea3f31c2427ca2e8dfff6ea8d108473bd6e264e..b945a58b2bc518368f9c546351984ad4f8e3eb9f 100644
--- a/chrome/browser/ui/search/instant_tab.cc
+++ b/chrome/browser/ui/search/instant_tab.cc
@@ -20,27 +20,12 @@ InstantTab::~InstantTab() {
}
}
-bool InstantTab::supports_instant() const {
- return web_contents() &&
- SearchTabHelper::FromWebContents(web_contents())->SupportsInstant();
-}
-
-bool InstantTab::IsLocal() const {
- return web_contents() &&
- web_contents()->GetURL() == GURL(chrome::kChromeSearchLocalNtpUrl);
-}
-
-InstantTab::InstantTab(Delegate* delegate)
+InstantTab::InstantTab(Delegate* delegate, content::WebContents* contents)
: delegate_(delegate) {
-}
-
-void InstantTab::Init(content::WebContents* new_web_contents) {
- ClearContents();
-
- if (!new_web_contents)
+ if (!contents)
return;
- Observe(new_web_contents);
+ Observe(contents);
SearchModel* model =
SearchTabHelper::FromWebContents(web_contents())->model();
model->AddObserver(this);
@@ -60,7 +45,7 @@ void InstantTab::DidCommitProvisionalLoadForFrame(
}
void InstantTab::ModelChanged(const SearchModel::State& old_state,
- const SearchModel::State& new_state) {
+ const SearchModel::State& new_state) {
if (old_state.instant_support != new_state.instant_support)
InstantSupportDetermined(new_state.instant_support == INSTANT_SUPPORT_YES);
}
@@ -79,5 +64,5 @@ void InstantTab::ClearContents() {
this);
}
- Observe(NULL);
+ Observe(nullptr);
}

Powered by Google App Engine
This is Rietveld 408576698