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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 explicit SearchTabHelper(content::WebContents* web_contents); | 45 explicit SearchTabHelper(content::WebContents* web_contents); |
46 | 46 |
47 // Overridden from content::NotificationObserver: | 47 // Overridden from content::NotificationObserver: |
48 virtual void Observe(int type, | 48 virtual void Observe(int type, |
49 const content::NotificationSource& source, | 49 const content::NotificationSource& source, |
50 const content::NotificationDetails& details) OVERRIDE; | 50 const content::NotificationDetails& details) OVERRIDE; |
51 | 51 |
52 // Overridden from contents::WebContentsObserver: | 52 // Overridden from contents::WebContentsObserver: |
53 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 53 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 54 virtual void DidFinishLoad( |
| 55 int64 frame_id, |
| 56 const GURL& validated_url, |
| 57 bool is_main_frame, |
| 58 content::RenderViewHost* render_view_host) OVERRIDE; |
54 | 59 |
55 // Sets the mode of the model based on the current URL of web_contents(). | 60 // Sets the mode of the model based on the current URL of web_contents(). |
56 void UpdateMode(); | 61 void UpdateMode(); |
57 | 62 |
| 63 // Send an IPC to web_contents() to attempt to discover whether it supports |
| 64 // instant. |
| 65 void DetermineIfPageSupportsInstant(); |
| 66 |
58 // Handlers for SearchBox API to show and hide top bars (bookmark and info | 67 // Handlers for SearchBox API to show and hide top bars (bookmark and info |
59 // bars). | 68 // bars). |
60 void OnSearchBoxShowBars(int page_id); | 69 void OnSearchBoxShowBars(int page_id); |
61 void OnSearchBoxHideBars(int page_id); | 70 void OnSearchBoxHideBars(int page_id); |
62 | 71 |
| 72 // Handler for when Instant support has been determined. |
| 73 void OnInstantSupportDetermined(int page_id, bool supports_instant); |
| 74 |
63 const bool is_search_enabled_; | 75 const bool is_search_enabled_; |
64 | 76 |
65 // Tracks the last value passed to OmniboxEditModelChanged(). | 77 // Tracks the last value passed to OmniboxEditModelChanged(). |
66 bool user_input_in_progress_; | 78 bool user_input_in_progress_; |
67 | 79 |
68 // Model object for UI that cares about search state. | 80 // Model object for UI that cares about search state. |
69 SearchModel model_; | 81 SearchModel model_; |
70 | 82 |
71 content::NotificationRegistrar registrar_; | 83 content::NotificationRegistrar registrar_; |
72 | 84 |
73 content::WebContents* web_contents_; | 85 content::WebContents* web_contents_; |
74 | 86 |
75 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 87 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
76 }; | 88 }; |
77 | 89 |
78 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 90 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |