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

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

Issue 2845303002: Remove InstantTab::Delegate::InstantSupportDetermined (Closed)
Patch Set: Created 3 years, 8 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/search/instant_tab.h ('k') | chrome/browser/ui/search/instant_tab_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 180d8952ae4e8bd94219d112823c75da01811e9c..7193a547e8f8b74eb04bbc99e08fb6ac96a18278 100644
--- a/chrome/browser/ui/search/instant_tab.cc
+++ b/chrome/browser/ui/search/instant_tab.cc
@@ -4,11 +4,7 @@
#include "chrome/browser/ui/search/instant_tab.h"
-#include "chrome/browser/ui/search/search_model.h"
-#include "chrome/browser/ui/search/search_tab_helper.h"
-#include "chrome/common/url_constants.h"
#include "content/public/browser/navigation_handle.h"
-#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
InstantTab::Delegate::~Delegate() {}
@@ -16,12 +12,7 @@ InstantTab::Delegate::~Delegate() {}
InstantTab::InstantTab(Delegate* delegate, content::WebContents* web_contents)
: delegate_(delegate), pending_web_contents_(web_contents) {}
-InstantTab::~InstantTab() {
- if (web_contents()) {
- SearchTabHelper::FromWebContents(web_contents())->model()->RemoveObserver(
- this);
- }
-}
+InstantTab::~InstantTab() {}
void InstantTab::Init() {
if (!pending_web_contents_)
@@ -29,14 +20,6 @@ void InstantTab::Init() {
Observe(pending_web_contents_);
pending_web_contents_ = nullptr;
-
- SearchModel* model =
- SearchTabHelper::FromWebContents(web_contents())->model();
- model->AddObserver(this);
-
- // Already know whether the page supports instant.
- if (model->instant_support() != INSTANT_SUPPORT_UNKNOWN)
- InstantSupportDetermined(model->instant_support() == INSTANT_SUPPORT_YES);
}
void InstantTab::DidFinishNavigation(
@@ -46,23 +29,3 @@ void InstantTab::DidFinishNavigation(
web_contents(), navigation_handle->GetURL());
}
}
-
-void InstantTab::ModelChanged(const SearchModel::State& old_state,
- const SearchModel::State& new_state) {
- if (old_state.instant_support != new_state.instant_support)
- InstantSupportDetermined(new_state.instant_support == INSTANT_SUPPORT_YES);
-}
-
-void InstantTab::InstantSupportDetermined(bool supports_instant) {
- delegate_->InstantSupportDetermined(web_contents(), supports_instant);
-
- // If the page doesn't support Instant, stop listening to it.
- if (!supports_instant) {
- if (web_contents()) {
- SearchTabHelper::FromWebContents(web_contents())->model()->RemoveObserver(
- this);
- }
-
- Observe(nullptr);
- }
-}
« no previous file with comments | « chrome/browser/ui/search/instant_tab.h ('k') | chrome/browser/ui/search/instant_tab_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698