| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Send autocomplete results from |providers| to the preview page. | 84 // Send autocomplete results from |providers| to the preview page. |
| 85 void HandleAutocompleteResults( | 85 void HandleAutocompleteResults( |
| 86 const std::vector<AutocompleteProvider*>& providers); | 86 const std::vector<AutocompleteProvider*>& providers); |
| 87 | 87 |
| 88 // Called when the user presses up or down. |count| is a repeat count, | 88 // Called when the user presses up or down. |count| is a repeat count, |
| 89 // negative for moving up, positive for moving down. Returns true if Instant | 89 // negative for moving up, positive for moving down. Returns true if Instant |
| 90 // handled the key press. | 90 // handled the key press. |
| 91 bool OnUpOrDownKeyPressed(int count); | 91 bool OnUpOrDownKeyPressed(int count); |
| 92 | 92 |
| 93 // Called when the user has arrowed into the selections but want to cancel, |
| 94 // typically by pressing ESC. The omnibox text is expected to have been |
| 95 // reverted by Chrome prior to calling this. |
| 96 bool OnCancel(); |
| 97 |
| 93 // The preview WebContents. May be NULL. InstantController retains ownership. | 98 // The preview WebContents. May be NULL. InstantController retains ownership. |
| 94 content::WebContents* GetPreviewContents() const; | 99 content::WebContents* GetPreviewContents() const; |
| 95 | 100 |
| 96 // Returns true if the Instant preview is showing a search results preview. | 101 // Returns true if the Instant preview is showing a search results preview. |
| 97 bool IsPreviewingSearchResults() const; | 102 bool IsPreviewingSearchResults() const; |
| 98 | 103 |
| 99 // If the preview is showing search results, commits the preview, calling | 104 // If the preview is showing search results, commits the preview, calling |
| 100 // CommitInstant() on the browser, and returns true. Else, returns false. | 105 // CommitInstant() on the browser, and returns true. Else, returns false. |
| 101 bool CommitIfPossible(InstantCommitType type); | 106 bool CommitIfPossible(InstantCommitType type); |
| 102 | 107 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 362 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
| 358 bool allow_preview_to_show_search_suggestions_; | 363 bool allow_preview_to_show_search_suggestions_; |
| 359 | 364 |
| 360 // List of events and their timestamps, useful in debugging Instant behaviour. | 365 // List of events and their timestamps, useful in debugging Instant behaviour. |
| 361 mutable std::list<std::pair<int64, std::string> > debug_events_; | 366 mutable std::list<std::pair<int64, std::string> > debug_events_; |
| 362 | 367 |
| 363 DISALLOW_COPY_AND_ASSIGN(InstantController); | 368 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 364 }; | 369 }; |
| 365 | 370 |
| 366 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 371 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
| OLD | NEW |