| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void SetSelectedLineState(LineState state); | 92 void SetSelectedLineState(LineState state); |
| 93 | 93 |
| 94 // Called when the user hits shift-delete. This should determine if the item | 94 // 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. | 95 // can be removed from history, and if so, remove it and update the popup. |
| 96 void TryDeletingCurrentItem(); | 96 void TryDeletingCurrentItem(); |
| 97 | 97 |
| 98 // If |match| is from an extension, returns the extension icon; otherwise | 98 // If |match| is from an extension, returns the extension icon; otherwise |
| 99 // returns an empty Image. | 99 // returns an empty Image. |
| 100 gfx::Image GetIconIfExtensionMatch(const AutocompleteMatch& match) const; | 100 gfx::Image GetIconIfExtensionMatch(const AutocompleteMatch& match) const; |
| 101 | 101 |
| 102 // Returns true if the destination URL of the match is bookmarked. |
| 103 bool IsStarredMatch(const AutocompleteMatch& match) const; |
| 104 |
| 102 // The match the user has manually chosen, if any. | 105 // The match the user has manually chosen, if any. |
| 103 const AutocompleteResult::Selection& manually_selected_match() const { | 106 const AutocompleteResult::Selection& manually_selected_match() const { |
| 104 return manually_selected_match_; | 107 return manually_selected_match_; |
| 105 } | 108 } |
| 106 | 109 |
| 107 // Invoked from the edit model any time the result set of the controller | 110 // Invoked from the edit model any time the result set of the controller |
| 108 // changes. | 111 // changes. |
| 109 void OnResultChanged(); | 112 void OnResultChanged(); |
| 110 | 113 |
| 111 // Add and remove observers. | 114 // Add and remove observers. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 137 // The match the user has manually chosen, if any. | 140 // The match the user has manually chosen, if any. |
| 138 AutocompleteResult::Selection manually_selected_match_; | 141 AutocompleteResult::Selection manually_selected_match_; |
| 139 | 142 |
| 140 // Observers. | 143 // Observers. |
| 141 ObserverList<OmniboxPopupModelObserver> observers_; | 144 ObserverList<OmniboxPopupModelObserver> observers_; |
| 142 | 145 |
| 143 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupModel); | 146 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupModel); |
| 144 }; | 147 }; |
| 145 | 148 |
| 146 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ | 149 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_MODEL_H_ |
| OLD | NEW |