Chromium Code Reviews| 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..71edbf51e99aca675b3f0a345de596a4dff945c7 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 InstantPageTest; |
| + |
| // 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,19 @@ 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, |
|
samarth
2013/05/10 01:32:38
Rather than exposing this handler (which requires
kmadhusu
2013/05/13 17:13:24
Done.
|
| + bool supports_instant); |
| + |
| private: |
| friend class content::WebContentsUserData<SearchTabHelper>; |
| + friend class InstantPageTest; |
| + FRIEND_TEST_ALL_PREFIXES(InstantPageTest, |
| + DetermineIfPageSupportsInstant_Local); |
| + FRIEND_TEST_ALL_PREFIXES(InstantPageTest, |
| + DetermineIfPageSupportsInstant_NonLocal); |
| + FRIEND_TEST_ALL_PREFIXES(InstantPageTest, |
| + PageSupportsInstant); |
| explicit SearchTabHelper(content::WebContents* web_contents); |
| @@ -54,10 +68,20 @@ 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(); |
| + // Tells the renderer to determine if the page supports the Instant API, which |
| + // results in a call to OnInstantSupportDeterminedMsgReceived() when the reply |
| + // is received. |
| + void DetermineIfPageSupportsInstant(); |
| + |
| // Handlers for SearchBox API to show and hide top bars (bookmark and info |
| // bars). |
| void OnSearchBoxShowBars(int page_id); |