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

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

Issue 14911005: Move instant support to SearchTabHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments Created 7 years, 7 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 7b0ff13c929168030b4268cbd594dca5c77696ae..351bab61c5d95d2f68f719bccc96d398a560faed 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/compiler_specific.h"
+#include "base/gtest_prod_util.h"
#include "chrome/browser/ui/search/search_model.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -17,6 +18,8 @@ namespace content {
class WebContents;
}
+class InstantSupportTest;
+
// Per-tab search "helper". Acts as the owner and controller of the tab's
// search UI model.
class SearchTabHelper : public content::NotificationObserver,
@@ -42,8 +45,16 @@ class SearchTabHelper : public content::NotificationObserver,
// the notification system and shouldn't call this method.
void NavigationEntryUpdated();
+ // Handler for when Instant support has been determined.
+ void OnInstantSupportDeterminedMsgReceived(int page_id,
+ bool supports_instant);
+
private:
friend class content::WebContentsUserData<SearchTabHelper>;
+ friend class InstantSupportTest;
+ FRIEND_TEST_ALL_PREFIXES(InstantSupportTest,
+ DispatchDetermineIfPageSupportsInstantMsg);
+ FRIEND_TEST_ALL_PREFIXES(InstantSupportTest, PageSupportsInstant);
explicit SearchTabHelper(content::WebContents* web_contents);
@@ -54,10 +65,19 @@ class SearchTabHelper : public content::NotificationObserver,
// Overridden from contents::WebContentsObserver:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void DidFinishLoad(
+ int64 frame_id,
+ const GURL& validated_url,
+ bool is_main_frame,
+ content::RenderViewHost* render_view_host) OVERRIDE;
// Sets the mode of the model based on the current URL of web_contents().
void UpdateMode();
+ // Send an IPC to web_contents() to attempt to discover whether it supports
+ // instant.
+ void DetermineIfPageSupportsInstant();
+
// Handlers for SearchBox API to show and hide top bars (bookmark and info
// bars).
void OnSearchBoxShowBars(int page_id);

Powered by Google App Engine
This is Rietveld 408576698