| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, | 121 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 122 OnChromeIdentityCheckSignedOutMatch); | 122 OnChromeIdentityCheckSignedOutMatch); |
| 123 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, | 123 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 124 OnChromeIdentityCheckSignedOutMismatch); | 124 OnChromeIdentityCheckSignedOutMismatch); |
| 125 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, | 125 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 126 OnHistorySyncCheckSyncInactive); | 126 OnHistorySyncCheckSyncInactive); |
| 127 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, | 127 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 128 OnHistorySyncCheckSyncing); | 128 OnHistorySyncCheckSyncing); |
| 129 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, | 129 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 130 OnHistorySyncCheckNotSyncing); | 130 OnHistorySyncCheckNotSyncing); |
| 131 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 132 OnMostVisitedItemsChangedFromServer); |
| 133 FRIEND_TEST_ALL_PREFIXES(SearchTabHelperTest, |
| 134 OnMostVisitedItemsChangedFromClient); |
| 131 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, | 135 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, |
| 132 IgnoreMessageIfThePageIsNotActive); | 136 IgnoreMessageIfThePageIsNotActive); |
| 133 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, | 137 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, |
| 134 DoNotSendSetDisplayInstantResultsMsg); | 138 DoNotSendSetDisplayInstantResultsMsg); |
| 135 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, HandleTabChangedEvents); | 139 FRIEND_TEST_ALL_PREFIXES(SearchIPCRouterTest, HandleTabChangedEvents); |
| 136 FRIEND_TEST_ALL_PREFIXES(InstantPageTest, | 140 FRIEND_TEST_ALL_PREFIXES(InstantPageTest, |
| 137 DetermineIfPageSupportsInstant_Local); | 141 DetermineIfPageSupportsInstant_Local); |
| 138 FRIEND_TEST_ALL_PREFIXES(InstantPageTest, | 142 FRIEND_TEST_ALL_PREFIXES(InstantPageTest, |
| 139 DetermineIfPageSupportsInstant_NonLocal); | 143 DetermineIfPageSupportsInstant_NonLocal); |
| 140 FRIEND_TEST_ALL_PREFIXES(InstantPageTest, | 144 FRIEND_TEST_ALL_PREFIXES(InstantPageTest, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 202 |
| 199 Profile* profile() const; | 203 Profile* profile() const; |
| 200 | 204 |
| 201 // Returns whether input is in progress, i.e. if the omnibox has focus and the | 205 // Returns whether input is in progress, i.e. if the omnibox has focus and the |
| 202 // active tab is in mode SEARCH_SUGGESTIONS. | 206 // active tab is in mode SEARCH_SUGGESTIONS. |
| 203 bool IsInputInProgress() const; | 207 bool IsInputInProgress() const; |
| 204 | 208 |
| 205 // Returns the OmniboxView for |web_contents_| or NULL if not available. | 209 // Returns the OmniboxView for |web_contents_| or NULL if not available. |
| 206 OmniboxView* GetOmniboxView() const; | 210 OmniboxView* GetOmniboxView() const; |
| 207 | 211 |
| 212 // Record whether each suggestion comes from server or client. |
| 213 void LogMostVisitedItemsSource( |
| 214 const std::vector<InstantMostVisitedItem>& items); |
| 215 |
| 208 typedef bool (*OmniboxHasFocusFn)(OmniboxView*); | 216 typedef bool (*OmniboxHasFocusFn)(OmniboxView*); |
| 209 | 217 |
| 210 void set_omnibox_has_focus_fn(OmniboxHasFocusFn fn) { | 218 void set_omnibox_has_focus_fn(OmniboxHasFocusFn fn) { |
| 211 omnibox_has_focus_fn_ = fn; | 219 omnibox_has_focus_fn_ = fn; |
| 212 } | 220 } |
| 213 | 221 |
| 214 const bool is_search_enabled_; | 222 const bool is_search_enabled_; |
| 215 | 223 |
| 216 // Model object for UI that cares about search state. | 224 // Model object for UI that cares about search state. |
| 217 SearchModel model_; | 225 SearchModel model_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 228 SearchTabHelperDelegate* delegate_; | 236 SearchTabHelperDelegate* delegate_; |
| 229 | 237 |
| 230 // Function to check if the omnibox has focus. Tests use this to modify the | 238 // Function to check if the omnibox has focus. Tests use this to modify the |
| 231 // default behavior. | 239 // default behavior. |
| 232 OmniboxHasFocusFn omnibox_has_focus_fn_; | 240 OmniboxHasFocusFn omnibox_has_focus_fn_; |
| 233 | 241 |
| 234 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 242 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
| 235 }; | 243 }; |
| 236 | 244 |
| 237 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 245 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
| OLD | NEW |