| 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_INSTANT_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 // Invoked by InstantLoader when the instant page is about to navigate. | 168 // Invoked by InstantLoader when the instant page is about to navigate. |
| 169 void InstantLoaderAboutToNavigateMainFrame(const GURL& url); | 169 void InstantLoaderAboutToNavigateMainFrame(const GURL& url); |
| 170 | 170 |
| 171 // Invoked by the InstantLoader when the instant page wants to navigate to | 171 // Invoked by the InstantLoader when the instant page wants to navigate to |
| 172 // the speicfied URL. | 172 // the speicfied URL. |
| 173 void NavigateToURL(const GURL& url, content::PageTransition transition); | 173 void NavigateToURL(const GURL& url, content::PageTransition transition); |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 FRIEND_TEST_ALL_PREFIXES(InstantTest, OmniboxFocusLoadsInstant); | 176 FRIEND_TEST_ALL_PREFIXES(InstantTest, OmniboxFocusLoadsInstant); |
| 177 FRIEND_TEST_ALL_PREFIXES(InstantTest, SetWithTemplateURL); |
| 177 FRIEND_TEST_ALL_PREFIXES(InstantTest, NonInstantSearchProvider); | 178 FRIEND_TEST_ALL_PREFIXES(InstantTest, NonInstantSearchProvider); |
| 178 FRIEND_TEST_ALL_PREFIXES(InstantTest, InstantLoaderRefresh); | 179 FRIEND_TEST_ALL_PREFIXES(InstantTest, InstantLoaderRefresh); |
| 180 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ExtendedModeIsOn); |
| 181 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, OmniboxFocusLoadsInstant); |
| 179 | 182 |
| 180 // Helper for OmniboxFocusChanged. Commit or discard the preview. | 183 // Helper for OmniboxFocusChanged. Commit or discard the preview. |
| 181 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); | 184 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); |
| 182 | 185 |
| 183 // Creates a new loader if necessary, using the instant_url property of the | 186 // Creates a new loader if necessary, using the instant_url property of the |
| 184 // |template_url| (for example, if the Instant URL has changed since the last | 187 // |template_url| (for example, if the Instant URL has changed since the last |
| 185 // time the loader was created). If |fallback_to_local| is true will use | 188 // time the loader was created). If |fallback_to_local| is true will use |
| 186 // kLocalOmniboxPopupURL as the fallback url (in extended mode) in case | 189 // kLocalOmniboxPopupURL as the fallback url (in extended mode) in case |
| 187 // the |template_url| doesn't have a valid Instant URL. Returns true if an | 190 // the |template_url| doesn't have a valid Instant URL. Returns true if an |
| 188 // instant URL could be determined. | 191 // instant URL could be determined. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 324 |
| 322 // Whether to allow the preview to show search suggestions. In general, the | 325 // Whether to allow the preview to show search suggestions. In general, the |
| 323 // preview is allowed to show search suggestions whenever |search_mode_| is | 326 // preview is allowed to show search suggestions whenever |search_mode_| is |
| 324 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 327 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
| 325 bool allow_preview_to_show_search_suggestions_; | 328 bool allow_preview_to_show_search_suggestions_; |
| 326 | 329 |
| 327 DISALLOW_COPY_AND_ASSIGN(InstantController); | 330 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 328 }; | 331 }; |
| 329 | 332 |
| 330 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 333 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |