Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_popup_model.h

Issue 2973006: Use the extension icon for extension omnibox results instead of the generic (Closed)
Patch Set: fixed mac Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_popup_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_MODEL_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_MODEL_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_MODEL_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_MODEL_H_
7 7
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "chrome/browser/autocomplete/autocomplete.h" 9 #include "chrome/browser/autocomplete/autocomplete.h"
10 #include "chrome/common/notification_registrar.h" 10 #include "chrome/common/notification_registrar.h"
11 11
12 class AutocompleteEditModel; 12 class AutocompleteEditModel;
13 class AutocompleteEditView; 13 class AutocompleteEditView;
14 class Profile; 14 class Profile;
15 class SkBitmap;
15 16
16 class AutocompletePopupView; 17 class AutocompletePopupView;
17 18
18 class AutocompletePopupModel : public NotificationObserver { 19 class AutocompletePopupModel : public NotificationObserver {
19 public: 20 public:
20 AutocompletePopupModel(AutocompletePopupView* popup_view, 21 AutocompletePopupModel(AutocompletePopupView* popup_view,
21 AutocompleteEditModel* edit_model, 22 AutocompleteEditModel* edit_model,
22 Profile* profile); 23 Profile* profile);
23 ~AutocompletePopupModel(); 24 ~AutocompletePopupModel();
24 25
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // current selection down (|count| > 0) or up (|count| < 0), clamping to the 104 // current selection down (|count| > 0) or up (|count| < 0), clamping to the
104 // first or last result if necessary. If |count| == 0, the selection will be 105 // first or last result if necessary. If |count| == 0, the selection will be
105 // unchanged, but the popup will still redraw and modify the text in the 106 // unchanged, but the popup will still redraw and modify the text in the
106 // AutocompleteEditModel. 107 // AutocompleteEditModel.
107 void Move(int count); 108 void Move(int count);
108 109
109 // Called when the user hits shift-delete. This should determine if the item 110 // Called when the user hits shift-delete. This should determine if the item
110 // can be removed from history, and if so, remove it and update the popup. 111 // can be removed from history, and if so, remove it and update the popup.
111 void TryDeletingCurrentItem(); 112 void TryDeletingCurrentItem();
112 113
114 // Returns the special icon to use for a given match, or NULL if we should
115 // use a standard style icon.
116 const SkBitmap* GetSpecialIconForMatch(const AutocompleteMatch& match) const;
117
113 // The token value for selected_line_, hover_line_ and functions dealing with 118 // The token value for selected_line_, hover_line_ and functions dealing with
114 // a "line number" that indicates "no line". 119 // a "line number" that indicates "no line".
115 static const size_t kNoMatch = -1; 120 static const size_t kNoMatch = -1;
116 121
117 private: 122 private:
118 // NotificationObserver 123 // NotificationObserver
119 virtual void Observe(NotificationType type, 124 virtual void Observe(NotificationType type,
120 const NotificationSource& source, 125 const NotificationSource& source,
121 const NotificationDetails& details); 126 const NotificationDetails& details);
122 127
(...skipping 15 matching lines...) Expand all
138 // which should only be true when the popup is closed. 143 // which should only be true when the popup is closed.
139 size_t selected_line_; 144 size_t selected_line_;
140 145
141 // The match the user has manually chosen, if any. 146 // The match the user has manually chosen, if any.
142 AutocompleteResult::Selection manually_selected_match_; 147 AutocompleteResult::Selection manually_selected_match_;
143 148
144 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupModel); 149 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupModel);
145 }; 150 };
146 151
147 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_MODEL_H_ 152 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_popup_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698