| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Returns whether the preview will be committed when the mouse or touch | 121 // Returns whether the preview will be committed when the mouse or touch |
| 122 // pointer is released. | 122 // pointer is released. |
| 123 bool commit_on_pointer_release() const; | 123 bool commit_on_pointer_release() const; |
| 124 | 124 |
| 125 // Returns the transition type of the last AutocompleteMatch passed to Update. | 125 // Returns the transition type of the last AutocompleteMatch passed to Update. |
| 126 content::PageTransition last_transition_type() const { | 126 content::PageTransition last_transition_type() const { |
| 127 return last_transition_type_; | 127 return last_transition_type_; |
| 128 } | 128 } |
| 129 | 129 |
| 130 // InstantLoaderDelegate: | 130 // InstantLoaderDelegate: |
| 131 virtual void SetSuggestions(InstantLoader* loader, | 131 virtual void SetSuggestions( |
| 132 const std::vector<string16>& suggestions, | 132 InstantLoader* loader, |
| 133 InstantCompleteBehavior behavior) OVERRIDE; | 133 const std::vector<InstantSuggestion>& suggestions) OVERRIDE; |
| 134 virtual void CommitInstantLoader(InstantLoader* loader) OVERRIDE; | 134 virtual void CommitInstantLoader(InstantLoader* loader) OVERRIDE; |
| 135 virtual void InstantLoaderPreviewLoaded(InstantLoader* loader) OVERRIDE; | 135 virtual void InstantLoaderPreviewLoaded(InstantLoader* loader) OVERRIDE; |
| 136 virtual void InstantSupportDetermined(InstantLoader* loader, | 136 virtual void InstantSupportDetermined(InstantLoader* loader, |
| 137 bool supports_instant) OVERRIDE; | 137 bool supports_instant) OVERRIDE; |
| 138 virtual void SwappedTabContents(InstantLoader* loader) OVERRIDE; | 138 virtual void SwappedTabContents(InstantLoader* loader) OVERRIDE; |
| 139 virtual void InstantLoaderContentsFocused(InstantLoader* loader) OVERRIDE; | 139 virtual void InstantLoaderContentsFocused(InstantLoader* loader) OVERRIDE; |
| 140 | 140 |
| 141 #if defined(UNIT_TEST) | 141 #if defined(UNIT_TEST) |
| 142 // Accessors used only in tests. | 142 // Accessors used only in tests. |
| 143 bool is_showing() const { return is_showing_; } | 143 bool is_showing() const { return is_showing_; } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 string16 last_full_text_; | 189 string16 last_full_text_; |
| 190 | 190 |
| 191 // The most recent user_text passed to Update(). | 191 // The most recent user_text passed to Update(). |
| 192 string16 last_user_text_; | 192 string16 last_user_text_; |
| 193 | 193 |
| 194 // The most recent verbatim passed to Update(). | 194 // The most recent verbatim passed to Update(). |
| 195 bool last_verbatim_; | 195 bool last_verbatim_; |
| 196 | 196 |
| 197 // The most recent suggestion received from the page, minus any prefix that | 197 // The most recent suggestion received from the page, minus any prefix that |
| 198 // the user has typed. | 198 // the user has typed. |
| 199 string16 last_suggestion_; | 199 InstantSuggestion last_suggestion_; |
| 200 | |
| 201 // The most recent autocomplete behavior for |last_suggestion_|. | |
| 202 InstantCompleteBehavior last_complete_behavior_; | |
| 203 | 200 |
| 204 // See comments on the getter above. | 201 // See comments on the getter above. |
| 205 content::PageTransition last_transition_type_; | 202 content::PageTransition last_transition_type_; |
| 206 | 203 |
| 207 // True if the preview is currently being displayed. Guaranteed to be false | 204 // True if the preview is currently being displayed. Guaranteed to be false |
| 208 // if IsOutOfDate() is true. | 205 // if IsOutOfDate() is true. |
| 209 bool is_showing_; | 206 bool is_showing_; |
| 210 | 207 |
| 211 // True if we've received a response from the loader for the last Update(), | 208 // True if we've received a response from the loader for the last Update(), |
| 212 // thus indicating that the page is ready to be shown. | 209 // thus indicating that the page is ready to be shown. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 231 // Search terms extraction (for autocomplete history matches) doesn't work | 228 // Search terms extraction (for autocomplete history matches) doesn't work |
| 232 // on Instant URLs. So, whenever the user commits an Instant search, we add | 229 // on Instant URLs. So, whenever the user commits an Instant search, we add |
| 233 // an equivalent non-Instant search URL to history, so that the search shows | 230 // an equivalent non-Instant search URL to history, so that the search shows |
| 234 // up in autocomplete history matches. | 231 // up in autocomplete history matches. |
| 235 GURL url_for_history_; | 232 GURL url_for_history_; |
| 236 | 233 |
| 237 DISALLOW_COPY_AND_ASSIGN(InstantController); | 234 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 238 }; | 235 }; |
| 239 | 236 |
| 240 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 237 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |