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 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 UTF16ToUTF8(full_name).c_str()); | 1314 UTF16ToUTF8(full_name).c_str()); |
1315 gtk_label_set_text(GTK_LABEL(tab_to_search_partial_label_), | 1315 gtk_label_set_text(GTK_LABEL(tab_to_search_partial_label_), |
1316 UTF16ToUTF8(partial_name).c_str()); | 1316 UTF16ToUTF8(partial_name).c_str()); |
1317 | 1317 |
1318 if (last_keyword_ != keyword) { | 1318 if (last_keyword_ != keyword) { |
1319 last_keyword_ = keyword; | 1319 last_keyword_ = keyword; |
1320 | 1320 |
1321 if (is_extension_keyword) { | 1321 if (is_extension_keyword) { |
1322 const TemplateURL* template_url = | 1322 const TemplateURL* template_url = |
1323 template_url_service->GetTemplateURLForKeyword(keyword); | 1323 template_url_service->GetTemplateURLForKeyword(keyword); |
1324 const SkBitmap& bitmap = profile->GetExtensionService()-> | 1324 gfx::Image image = profile->GetExtensionService()-> |
1325 GetOmniboxIcon(template_url->GetExtensionId()); | 1325 GetOmniboxIcon(template_url->GetExtensionId()); |
1326 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(bitmap); | 1326 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), |
1327 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), pixbuf); | 1327 image.ToGdkPixbuf()); |
1328 g_object_unref(pixbuf); | |
1329 } else { | 1328 } else { |
1330 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 1329 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
1331 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), | 1330 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), |
1332 rb.GetNativeImageNamed(IDR_OMNIBOX_SEARCH).ToGdkPixbuf()); | 1331 rb.GetNativeImageNamed(IDR_OMNIBOX_SEARCH).ToGdkPixbuf()); |
1333 } | 1332 } |
1334 } | 1333 } |
1335 } | 1334 } |
1336 | 1335 |
1337 void LocationBarViewGtk::SetKeywordHintLabel(const string16& keyword) { | 1336 void LocationBarViewGtk::SetKeywordHintLabel(const string16& keyword) { |
1338 if (keyword.empty()) | 1337 if (keyword.empty()) |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2133 } | 2132 } |
2134 | 2133 |
2135 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2134 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2136 ExtensionAction* action) { | 2135 ExtensionAction* action) { |
2137 ExtensionPopupGtk::Show( | 2136 ExtensionPopupGtk::Show( |
2138 action->GetPopupUrl(current_tab_id_), | 2137 action->GetPopupUrl(current_tab_id_), |
2139 owner_->browser_, | 2138 owner_->browser_, |
2140 event_box_.get(), | 2139 event_box_.get(), |
2141 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2140 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2142 } | 2141 } |
OLD | NEW |