| 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_UI_SEARCH_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 bool OnUpOrDownKeyPressed(int count); | 114 bool OnUpOrDownKeyPressed(int count); |
| 115 | 115 |
| 116 // Called when the user has arrowed into the suggestions but wants to cancel, | 116 // Called when the user has arrowed into the suggestions but wants to cancel, |
| 117 // typically by pressing ESC. The omnibox text is expected to have been | 117 // typically by pressing ESC. The omnibox text is expected to have been |
| 118 // reverted to |full_text| by the OmniboxEditModel prior to calling this. | 118 // reverted to |full_text| by the OmniboxEditModel prior to calling this. |
| 119 // |match| is the match reverted to. | 119 // |match| is the match reverted to. |
| 120 void OnCancel(const AutocompleteMatch& match, | 120 void OnCancel(const AutocompleteMatch& match, |
| 121 const string16& user_text, | 121 const string16& user_text, |
| 122 const string16& full_text); | 122 const string16& full_text); |
| 123 | 123 |
| 124 // Called when the user has navigated to a URL. This will send an onsubmit |
| 125 // notification to the instant page. |
| 126 void OnNavigate(const string16& user_text); |
| 127 |
| 124 // The overlay WebContents. May be NULL. InstantController retains ownership. | 128 // The overlay WebContents. May be NULL. InstantController retains ownership. |
| 125 content::WebContents* GetOverlayContents() const; | 129 content::WebContents* GetOverlayContents() const; |
| 126 | 130 |
| 127 // Returns true if Instant is showing a search results overlay. Returns false | 131 // Returns true if Instant is showing a search results overlay. Returns false |
| 128 // if the overlay is not showing, or if it's showing only suggestions. | 132 // if the overlay is not showing, or if it's showing only suggestions. |
| 129 bool IsOverlayingSearchResults() const; | 133 bool IsOverlayingSearchResults() const; |
| 130 | 134 |
| 131 // If the overlay is showing search results, commits the overlay, calling | 135 // If the overlay is showing search results, commits the overlay, calling |
| 132 // CommitInstant() on the browser, and returns true. Else, returns false. | 136 // CommitInstant() on the browser, and returns true. Else, returns false. |
| 133 bool CommitIfPossible(InstantCommitType type); | 137 bool CommitIfPossible(InstantCommitType type); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 // Used for Top Sites async retrieval. | 463 // Used for Top Sites async retrieval. |
| 460 base::WeakPtrFactory<InstantController> weak_ptr_factory_; | 464 base::WeakPtrFactory<InstantController> weak_ptr_factory_; |
| 461 | 465 |
| 462 // Used to get notifications about Most Visted changes. | 466 // Used to get notifications about Most Visted changes. |
| 463 content::NotificationRegistrar registrar_; | 467 content::NotificationRegistrar registrar_; |
| 464 | 468 |
| 465 DISALLOW_COPY_AND_ASSIGN(InstantController); | 469 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 466 }; | 470 }; |
| 467 | 471 |
| 468 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 472 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| OLD | NEW |