Chromium Code Reviews| 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_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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 128 |
| 129 // Returns whether the preview will be committed when the mouse or touch | 129 // Returns whether the preview will be committed when the mouse or touch |
| 130 // pointer is released. | 130 // pointer is released. |
| 131 bool commit_on_pointer_release() const; | 131 bool commit_on_pointer_release() const; |
| 132 | 132 |
| 133 // Returns the transition type of the last AutocompleteMatch passed to Update. | 133 // Returns the transition type of the last AutocompleteMatch passed to Update. |
| 134 content::PageTransition last_transition_type() const { | 134 content::PageTransition last_transition_type() const { |
| 135 return last_transition_type_; | 135 return last_transition_type_; |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Returns true if Instant will offer up autocomplete suggestions. | |
| 139 bool IsSuggestEnabled() const { | |
|
Peter Kasting
2012/08/24 22:29:52
Nit: This should be unix_hacker()-style
sreeram
2012/08/24 23:18:12
Done.
| |
| 140 return mode_ == INSTANT || mode_ == SUGGEST; | |
| 141 } | |
| 142 | |
| 138 // InstantLoaderDelegate: | 143 // InstantLoaderDelegate: |
| 139 virtual void SetSuggestions( | 144 virtual void SetSuggestions( |
| 140 InstantLoader* loader, | 145 InstantLoader* loader, |
| 141 const std::vector<InstantSuggestion>& suggestions) OVERRIDE; | 146 const std::vector<InstantSuggestion>& suggestions) OVERRIDE; |
| 142 virtual void CommitInstantLoader(InstantLoader* loader) OVERRIDE; | 147 virtual void CommitInstantLoader(InstantLoader* loader) OVERRIDE; |
| 143 virtual void InstantLoaderPreviewLoaded(InstantLoader* loader) OVERRIDE; | 148 virtual void InstantLoaderPreviewLoaded(InstantLoader* loader) OVERRIDE; |
| 144 virtual void InstantSupportDetermined(InstantLoader* loader, | 149 virtual void InstantSupportDetermined(InstantLoader* loader, |
| 145 bool supports_instant) OVERRIDE; | 150 bool supports_instant) OVERRIDE; |
| 146 virtual void SwappedTabContents(InstantLoader* loader) OVERRIDE; | 151 virtual void SwappedTabContents(InstantLoader* loader) OVERRIDE; |
| 147 virtual void InstantLoaderContentsFocused(InstantLoader* loader) OVERRIDE; | 152 virtual void InstantLoaderContentsFocused(InstantLoader* loader) OVERRIDE; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 // Search terms extraction (for autocomplete history matches) doesn't work | 241 // Search terms extraction (for autocomplete history matches) doesn't work |
| 237 // on Instant URLs. So, whenever the user commits an Instant search, we add | 242 // on Instant URLs. So, whenever the user commits an Instant search, we add |
| 238 // an equivalent non-Instant search URL to history, so that the search shows | 243 // an equivalent non-Instant search URL to history, so that the search shows |
| 239 // up in autocomplete history matches. | 244 // up in autocomplete history matches. |
| 240 GURL url_for_history_; | 245 GURL url_for_history_; |
| 241 | 246 |
| 242 DISALLOW_COPY_AND_ASSIGN(InstantController); | 247 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 243 }; | 248 }; |
| 244 | 249 |
| 245 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 250 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |