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

Unified Diff: chrome/browser/cocoa/location_bar/selected_keyword_decoration.mm

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/location_bar/selected_keyword_decoration.mm
diff --git a/chrome/browser/cocoa/location_bar/selected_keyword_decoration.mm b/chrome/browser/cocoa/location_bar/selected_keyword_decoration.mm
index ebb62bf83c5dc61f1581b7af1f3a7ec15e36d338..3c593ac9358d077903ea75d848d7bc3dadb97a3e 100644
--- a/chrome/browser/cocoa/location_bar/selected_keyword_decoration.mm
+++ b/chrome/browser/cocoa/location_bar/selected_keyword_decoration.mm
@@ -30,12 +30,12 @@ CGFloat SelectedKeywordDecoration::GetWidthForSpace(CGFloat width) {
const CGFloat full_width =
GetWidthForImageAndLabel(search_image_, full_string_);
if (full_width <= width) {
- SetImage(search_image_);
+ BubbleDecoration::SetImage(search_image_);
SetLabel(full_string_);
return full_width;
}
- SetImage(nil);
+ BubbleDecoration::SetImage(nil);
const CGFloat no_image_width = GetWidthForImageAndLabel(nil, full_string_);
if (no_image_width <= width || !partial_string_) {
SetLabel(full_string_);
@@ -65,3 +65,9 @@ void SelectedKeywordDecoration::SetKeyword(const std::wstring& short_name,
[l10n_util::GetNSStringF(message_id, WideToUTF16(min_name)) copy]);
}
}
+
+void SelectedKeywordDecoration::SetImage(NSImage* image) {
+ if (image != search_image_)
+ search_image_.reset([image retain]);
+ BubbleDecoration::SetImage(image);
+}
« no previous file with comments | « chrome/browser/cocoa/location_bar/selected_keyword_decoration.h ('k') | chrome/browser/extensions/extension_icon_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698