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 <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 // Send autocomplete results from |providers| to the preview page. | 105 // Send autocomplete results from |providers| to the preview page. |
106 void HandleAutocompleteResults( | 106 void HandleAutocompleteResults( |
107 const std::vector<AutocompleteProvider*>& providers); | 107 const std::vector<AutocompleteProvider*>& providers); |
108 | 108 |
109 // Called when the user presses up or down. |count| is a repeat count, | 109 // Called when the user presses up or down. |count| is a repeat count, |
110 // negative for moving up, positive for moving down. Returns true if Instant | 110 // negative for moving up, positive for moving down. Returns true if Instant |
111 // handled the key press. | 111 // handled the key press. |
112 bool OnUpOrDownKeyPressed(int count); | 112 bool OnUpOrDownKeyPressed(int count); |
113 | 113 |
| 114 // Called when the user has arrowed into the suggestions but wants to cancel, |
| 115 // typically by pressing ESC. The omnibox text is expected to have been |
| 116 // reverted to |user_text| by the OmniboxEditModel prior to calling this. |
| 117 void OnCancel(const string16& user_text); |
| 118 |
114 // The preview WebContents. May be NULL. InstantController retains ownership. | 119 // The preview WebContents. May be NULL. InstantController retains ownership. |
115 content::WebContents* GetPreviewContents() const; | 120 content::WebContents* GetPreviewContents() const; |
116 | 121 |
117 // Returns true if the Instant preview is showing a search results preview. | 122 // Returns true if the Instant preview is showing a search results preview. |
118 bool IsPreviewingSearchResults() const; | 123 bool IsPreviewingSearchResults() const; |
119 | 124 |
120 // If the preview is showing search results, commits the preview, calling | 125 // If the preview is showing search results, commits the preview, calling |
121 // CommitInstant() on the browser, and returns true. Else, returns false. | 126 // CommitInstant() on the browser, and returns true. Else, returns false. |
122 bool CommitIfPossible(InstantCommitType type); | 127 bool CommitIfPossible(InstantCommitType type); |
123 | 128 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 393 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
389 bool allow_preview_to_show_search_suggestions_; | 394 bool allow_preview_to_show_search_suggestions_; |
390 | 395 |
391 // List of events and their timestamps, useful in debugging Instant behaviour. | 396 // List of events and their timestamps, useful in debugging Instant behaviour. |
392 mutable std::list<std::pair<int64, std::string> > debug_events_; | 397 mutable std::list<std::pair<int64, std::string> > debug_events_; |
393 | 398 |
394 DISALLOW_COPY_AND_ASSIGN(InstantController); | 399 DISALLOW_COPY_AND_ASSIGN(InstantController); |
395 }; | 400 }; |
396 | 401 |
397 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 402 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |