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_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ | 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 // will change the selected line back to the default match and redraw. | 79 // will change the selected line back to the default match and redraw. |
| 80 void ResetToDefaultMatch(); | 80 void ResetToDefaultMatch(); |
| 81 | 81 |
| 82 // Immediately updates and opens the popup if necessary, then moves the | 82 // Immediately updates and opens the popup if necessary, then moves the |
| 83 // current selection down (|count| > 0) or up (|count| < 0), clamping to the | 83 // current selection down (|count| > 0) or up (|count| < 0), clamping to the |
| 84 // first or last result if necessary. If |count| == 0, the selection will be | 84 // first or last result if necessary. If |count| == 0, the selection will be |
| 85 // unchanged, but the popup will still redraw and modify the text in the | 85 // unchanged, but the popup will still redraw and modify the text in the |
| 86 // OmniboxEditModel. | 86 // OmniboxEditModel. |
| 87 void Move(int count); | 87 void Move(int count); |
| 88 | 88 |
| 89 // If the selected line has both a normal match and a keyword match, this can | 89 // If the selected line has both a normal match and a keyword match, this can |
|
Mark P
2015/04/21 21:54:08
FYI: I would love if this is said associated_keywo
Peter Kasting
2015/04/21 21:58:00
I think that's a slight layering violation, commen
| |
| 90 // be used to choose which to select. It is an error to call this when the | 90 // be used to choose which to select. This allows the user to toggle between |
| 91 // selected line does not have both matches (or there is no selection). | 91 // normal and keyword mode with tab/shift-tab without rerunning autocomplete |
| 92 // or disturbing other popup state, which in turn is an important part of | |
| 93 // supporting the use of tab to do both tab-to-search and | |
| 94 // tab-to-traverse-dropdown. | |
| 95 // | |
| 96 // It is an error to call this when the selected line does not have both | |
| 97 // matches (or there is no selection). | |
| 92 void SetSelectedLineState(LineState state); | 98 void SetSelectedLineState(LineState state); |
| 93 | 99 |
| 94 // Called when the user hits shift-delete. This should determine if the item | 100 // Called when the user hits shift-delete. This should determine if the item |
| 95 // can be removed from history, and if so, remove it and update the popup. | 101 // can be removed from history, and if so, remove it and update the popup. |
| 96 void TryDeletingCurrentItem(); | 102 void TryDeletingCurrentItem(); |
| 97 | 103 |
| 98 // If |match| is from an extension, returns the extension icon; otherwise | 104 // If |match| is from an extension, returns the extension icon; otherwise |
| 99 // returns an empty Image. | 105 // returns an empty Image. |
| 100 gfx::Image GetIconIfExtensionMatch(const AutocompleteMatch& match) const; | 106 gfx::Image GetIconIfExtensionMatch(const AutocompleteMatch& match) const; |
| 101 | 107 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 // The match the user has manually chosen, if any. | 146 // The match the user has manually chosen, if any. |
| 141 AutocompleteResult::Selection manually_selected_match_; | 147 AutocompleteResult::Selection manually_selected_match_; |
| 142 | 148 |
| 143 // Observers. | 149 // Observers. |
| 144 ObserverList<OmniboxPopupModelObserver> observers_; | 150 ObserverList<OmniboxPopupModelObserver> observers_; |
| 145 | 151 |
| 146 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupModel); | 152 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupModel); |
| 147 }; | 153 }; |
| 148 | 154 |
| 149 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ | 155 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ |
| OLD | NEW |