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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 int position, const base::string16& provider) OVERRIDE; | 176 int position, const base::string16& provider) OVERRIDE; |
177 virtual void PasteIntoOmnibox(const base::string16& text) OVERRIDE; | 177 virtual void PasteIntoOmnibox(const base::string16& text) OVERRIDE; |
178 virtual void OnChromeIdentityCheck(const base::string16& identity) OVERRIDE; | 178 virtual void OnChromeIdentityCheck(const base::string16& identity) OVERRIDE; |
179 | 179 |
180 // Overridden from InstantServiceObserver: | 180 // Overridden from InstantServiceObserver: |
181 virtual void ThemeInfoChanged(const ThemeBackgroundInfo& theme_info) OVERRIDE; | 181 virtual void ThemeInfoChanged(const ThemeBackgroundInfo& theme_info) OVERRIDE; |
182 virtual void MostVisitedItemsChanged( | 182 virtual void MostVisitedItemsChanged( |
183 const std::vector<InstantMostVisitedItem>& items) OVERRIDE; | 183 const std::vector<InstantMostVisitedItem>& items) OVERRIDE; |
184 virtual void OmniboxStartMarginChanged(int omnibox_start_margin) OVERRIDE; | 184 virtual void OmniboxStartMarginChanged(int omnibox_start_margin) OVERRIDE; |
185 | 185 |
186 // Removes recommended URLs if a matching URL is already open in the Browser, | |
187 // if the Most Visited Tile Placement experiment is enabled, and the client is | |
188 // in the experiment group. | |
189 void MaybeRemoveMostVisitedItems(std::vector<InstantMostVisitedItem>* items); | |
190 | |
191 // Sets the mode of the model based on the current URL of web_contents(). | 186 // Sets the mode of the model based on the current URL of web_contents(). |
192 // Only updates the origin part of the mode if |update_origin| is true, | 187 // Only updates the origin part of the mode if |update_origin| is true, |
193 // otherwise keeps the current origin. If |is_preloaded_ntp| is true, the mode | 188 // otherwise keeps the current origin. If |is_preloaded_ntp| is true, the mode |
194 // is set to NTP regardless of the current URL; this is used to ensure that | 189 // is set to NTP regardless of the current URL; this is used to ensure that |
195 // InstantController can bind InstantTab to new tab pages immediately. | 190 // InstantController can bind InstantTab to new tab pages immediately. |
196 void UpdateMode(bool update_origin, bool is_preloaded_ntp); | 191 void UpdateMode(bool update_origin, bool is_preloaded_ntp); |
197 | 192 |
198 // Tells the renderer to determine if the page supports the Instant API, which | 193 // Tells the renderer to determine if the page supports the Instant API, which |
199 // results in a call to OnInstantSupportDetermined() when the reply is | 194 // results in a call to OnInstantSupportDetermined() when the reply is |
200 // received. | 195 // received. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 SearchTabHelperDelegate* delegate_; | 234 SearchTabHelperDelegate* delegate_; |
240 | 235 |
241 // Function to check if the omnibox has focus. Tests use this to modify the | 236 // Function to check if the omnibox has focus. Tests use this to modify the |
242 // default behavior. | 237 // default behavior. |
243 OmniboxHasFocusFn omnibox_has_focus_fn_; | 238 OmniboxHasFocusFn omnibox_has_focus_fn_; |
244 | 239 |
245 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); | 240 DISALLOW_COPY_AND_ASSIGN(SearchTabHelper); |
246 }; | 241 }; |
247 | 242 |
248 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ | 243 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TAB_HELPER_H_ |
OLD | NEW |