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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc

Issue 1560015: Replace omnibox icons with new set that are all the same size (19x19).... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/browser/autocomplete/autocomplete_popup_view_gtk.h" 5 #include "chrome/browser/autocomplete/autocomplete_popup_view_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 pango_attr_list_insert(attrs, weight_attr); // Ownership taken. 158 pango_attr_list_insert(attrs, weight_attr); // Ownership taken.
159 } 159 }
160 160
161 pango_layout_set_text(layout, text_utf8.data(), text_utf8.size()); 161 pango_layout_set_text(layout, text_utf8.data(), text_utf8.size());
162 pango_layout_set_attributes(layout, attrs); // Ref taken. 162 pango_layout_set_attributes(layout, attrs); // Ref taken.
163 pango_attr_list_unref(attrs); 163 pango_attr_list_unref(attrs);
164 } 164 }
165 165
166 GdkPixbuf* IconForMatch(const AutocompleteMatch& match, bool selected) { 166 GdkPixbuf* IconForMatch(const AutocompleteMatch& match, bool selected) {
167 int icon = match.starred ? 167 int icon = match.starred ?
168 IDR_O2_STAR : AutocompleteMatch::TypeToIcon(match.type); 168 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match.type);
169 if (selected) { 169 if (selected) {
170 switch (icon) { 170 switch (icon) {
171 case IDR_O2_GLOBE: icon = IDR_O2_GLOBE_SELECTED_DARK; break; 171 case IDR_OMNIBOX_HTTP: icon = IDR_OMNIBOX_HTTP_DARK; break;
172 case IDR_O2_HISTORY: icon = IDR_O2_HISTORY_SELECTED_DARK; break; 172 case IDR_OMNIBOX_HISTORY: icon = IDR_OMNIBOX_HISTORY_DARK; break;
173 case IDR_O2_SEARCH: icon = IDR_O2_SEARCH_SELECTED_DARK; break; 173 case IDR_OMNIBOX_SEARCH: icon = IDR_OMNIBOX_SEARCH_DARK; break;
174 case IDR_O2_MORE: icon = IDR_O2_MORE_SELECTED_DARK; break; 174 case IDR_OMNIBOX_MORE: icon = IDR_OMNIBOX_MORE_DARK; break;
175 case IDR_O2_STAR: icon = IDR_O2_STAR_SELECTED_DARK; break; 175 case IDR_OMNIBOX_STAR: icon = IDR_OMNIBOX_STAR_DARK; break;
176 default: NOTREACHED(); break; 176 default: NOTREACHED(); break;
177 } 177 }
178 } 178 }
179 // TODO(deanm): These would be better as pixmaps someday. 179 // TODO(deanm): These would be better as pixmaps someday.
180 // TODO(estade): Do we want to flip these for RTL? (Windows doesn't). 180 // TODO(estade): Do we want to flip these for RTL? (Windows doesn't).
181 return ResourceBundle::GetSharedInstance().GetPixbufNamed(icon); 181 return ResourceBundle::GetSharedInstance().GetPixbufNamed(icon);
182 } 182 }
183 183
184 } // namespace 184 } // namespace
185 185
186 AutocompletePopupViewGtk::AutocompletePopupViewGtk( 186 AutocompletePopupViewGtk::AutocompletePopupViewGtk(
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // static 477 // static
478 AutocompletePopupView* AutocompletePopupView::CreatePopupView( 478 AutocompletePopupView* AutocompletePopupView::CreatePopupView(
479 const gfx::Font& font, 479 const gfx::Font& font,
480 AutocompleteEditView* edit_view, 480 AutocompleteEditView* edit_view,
481 AutocompleteEditModel* edit_model, 481 AutocompleteEditModel* edit_model,
482 Profile* profile, 482 Profile* profile,
483 const BubblePositioner* bubble_positioner) { 483 const BubblePositioner* bubble_positioner) {
484 return new AutocompletePopupViewGtk(edit_view, edit_model, profile, 484 return new AutocompletePopupViewGtk(edit_view, edit_model, profile,
485 bubble_positioner); 485 bubble_positioner);
486 } 486 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.cc ('k') | chrome/browser/cocoa/autocomplete_text_field_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698