| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/browser/ui/search/search_model.h" | 10 #include "chrome/browser/ui/search/search_model.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 explicit SearchTabHelper(content::WebContents* web_contents); | 48 explicit SearchTabHelper(content::WebContents* web_contents); |
| 49 | 49 |
| 50 // Overridden from content::NotificationObserver: | 50 // Overridden from content::NotificationObserver: |
| 51 virtual void Observe(int type, | 51 virtual void Observe(int type, |
| 52 const content::NotificationSource& source, | 52 const content::NotificationSource& source, |
| 53 const content::NotificationDetails& details) OVERRIDE; | 53 const content::NotificationDetails& details) OVERRIDE; |
| 54 | 54 |
| 55 // Overridden from contents::WebContentsObserver: | 55 // Overridden from contents::WebContentsObserver: |
| 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 57 virtual void DidFinishLoad( |
| 58 int64 frame_id, |
| 59 const GURL& validated_url, |
| 60 bool is_main_frame, |
| 61 content::RenderViewHost* render_view_host) OVERRIDE; |
| 57 | 62 |
| 58 // Sets the mode of the model based on the current URL of web_contents(). | 63 // Sets the mode of the model based on the current URL of web_contents(). |
| 59 void UpdateMode(); | 64 void UpdateMode(); |
| 60 | 65 |
| 66 // Send an IPC to web_contents() to attempt to discover whether it supports |
| 67 // instant. |
| 68 void DetermineIfPageSupportsInstant(); |
| 69 |
| 61 // Handlers for SearchBox API to show and hide top bars (bookmark and info | 70 // Handlers for SearchBox API to show and hide top bars (bookmark and info |
| 62 // bars). | 71 // bars). |
| 63 void OnSearchBoxShowBars(int page_id); | 72 void OnSearchBoxShowBars(int page_id); |
| 64 void OnSearchBoxHideBars(int page_id); | 73 void OnSearchBoxHideBars(int page_id); |
| 65 | 74 |
| 75 // Handler for when Instant support has been determined. |
| 76 void OnInstantSupportDetermined(int page_id, bool supports_instant); |
| 77 |
| 66 const bool is_search_enabled_; | 78 const bool is_search_enabled_; |
| 67 | 79 |
| 68 // Tracks the last value passed to OmniboxEditModelChanged(). | 80 // Tracks the last value passed to OmniboxEditModelChanged(). |
| 69 bool user_input_in_progress_; | 81 bool user_input_in_progress_; |
| 70 bool popup_is_open_; | 82 bool popup_is_open_; |
| 71 bool user_text_is_empty_; | 83 bool user_text_is_empty_; |
| 72 | 84 |
| 73 // Model object for UI that cares about search state. | 85 // Model object for UI that cares about search state. |
| 74 SearchModel model_; | 86 SearchModel model_; |
| 75 | 87 |
| 76 content::NotificationRegistrar registrar_; | 88 content::NotificationRegistrar registrar_; |
| 77 | 89 |
| 78 content::WebContents* web_contents_; | 90 content::WebContents* web_contents_; |
| 79 | 91 |
| 80 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 92 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
| 81 }; | 93 }; |
| 82 | 94 |
| 83 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 95 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
| OLD | NEW |