OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/common/web_contents_user_data.h" | 9 #include "chrome/browser/common/web_contents_user_data.h" |
10 #include "chrome/browser/ui/search/search_model.h" | 10 #include "chrome/browser/ui/search/search_model.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 // The document finished painting. | 91 // The document finished painting. |
92 PAINTED, | 92 PAINTED, |
93 }; | 93 }; |
94 | 94 |
95 // Sets the mode of the model based on |url|. |state| distinguishes between | 95 // Sets the mode of the model based on |url|. |state| distinguishes between |
96 // loading and loaded ntp states. |animate| is based on initial navigation | 96 // loading and loaded ntp states. |animate| is based on initial navigation |
97 // and used for the mode change on the |model_|. | 97 // and used for the mode change on the |model_|. |
98 void UpdateModelBasedOnURL(const GURL& url, NTPLoadState state, bool animate); | 98 void UpdateModelBasedOnURL(const GURL& url, NTPLoadState state, bool animate); |
99 | 99 |
| 100 // Checks if a search term can be extracted from the provided URL. |
| 101 bool CanExtractSearchTerms(const GURL& url); |
| 102 |
100 // Returns the web contents associated with the tab that owns this helper. | 103 // Returns the web contents associated with the tab that owns this helper. |
101 const content::WebContents* web_contents() const; | 104 const content::WebContents* web_contents() const; |
102 | 105 |
103 // Returns the current RenderWidgetHost of the |web_contents()|. | 106 // Returns the current RenderWidgetHost of the |web_contents()|. |
104 content::RenderWidgetHost* GetRenderWidgetHost(); | 107 content::RenderWidgetHost* GetRenderWidgetHost(); |
105 | 108 |
106 const bool is_search_enabled_; | 109 const bool is_search_enabled_; |
107 | 110 |
108 bool is_initial_navigation_commit_; | 111 bool is_initial_navigation_commit_; |
109 | 112 |
110 // Model object for UI that cares about search state. | 113 // Model object for UI that cares about search state. |
111 SearchModel model_; | 114 SearchModel model_; |
112 | 115 |
113 content::NotificationRegistrar registrar_; | 116 content::NotificationRegistrar registrar_; |
114 | 117 |
115 // See description above NTPLoadState. | 118 // See description above NTPLoadState. |
116 NTPLoadState ntp_load_state_; | 119 NTPLoadState ntp_load_state_; |
117 | 120 |
118 // See description above NTPLoadState. | 121 // See description above NTPLoadState. |
119 int64 main_frame_id_; | 122 int64 main_frame_id_; |
120 | 123 |
121 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 124 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
122 }; | 125 }; |
123 | 126 |
124 } // namespace search | 127 } // namespace search |
125 } // namespace chrome | 128 } // namespace chrome |
126 | 129 |
127 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 130 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |