| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
| 15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
| 18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 21 #include "chrome/app/chrome_command_ids.h" | 21 #include "chrome/app/chrome_command_ids.h" |
| 22 #include "chrome/browser/accessibility/accessibility_events.h" | 22 #include "chrome/browser/accessibility/accessibility_events.h" |
| 23 #include "chrome/browser/alternate_nav_url_fetcher.h" | 23 #include "chrome/browser/alternate_nav_url_fetcher.h" |
| 24 #include "chrome/browser/command_updater.h" | 24 #include "chrome/browser/command_updater.h" |
| 25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 26 #include "chrome/browser/defaults.h" | 26 #include "chrome/browser/defaults.h" |
| 27 #include "chrome/browser/extensions/api/commands/command_service.h" | 27 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 28 #include "chrome/browser/extensions/api/commands/command_service_factory.h" | 28 #include "chrome/browser/extensions/api/commands/command_service_factory.h" |
| 29 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
| 29 #include "chrome/browser/extensions/extension_action.h" | 30 #include "chrome/browser/extensions/extension_action.h" |
| 30 #include "chrome/browser/extensions/extension_service.h" | 31 #include "chrome/browser/extensions/extension_service.h" |
| 31 #include "chrome/browser/extensions/extension_tab_util.h" | 32 #include "chrome/browser/extensions/extension_tab_util.h" |
| 32 #include "chrome/browser/extensions/location_bar_controller.h" | 33 #include "chrome/browser/extensions/location_bar_controller.h" |
| 33 #include "chrome/browser/extensions/script_bubble_controller.h" | 34 #include "chrome/browser/extensions/script_bubble_controller.h" |
| 34 #include "chrome/browser/extensions/tab_helper.h" | 35 #include "chrome/browser/extensions/tab_helper.h" |
| 35 #include "chrome/browser/favicon/favicon_tab_helper.h" | 36 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 36 #include "chrome/browser/prefs/pref_service.h" | 37 #include "chrome/browser/prefs/pref_service.h" |
| 37 #include "chrome/browser/profiles/profile.h" | 38 #include "chrome/browser/profiles/profile.h" |
| 38 #include "chrome/browser/search_engines/template_url.h" | 39 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 UTF16ToUTF8(full_name).c_str()); | 1361 UTF16ToUTF8(full_name).c_str()); |
| 1361 gtk_label_set_text(GTK_LABEL(tab_to_search_partial_label_), | 1362 gtk_label_set_text(GTK_LABEL(tab_to_search_partial_label_), |
| 1362 UTF16ToUTF8(partial_name).c_str()); | 1363 UTF16ToUTF8(partial_name).c_str()); |
| 1363 | 1364 |
| 1364 if (last_keyword_ != keyword) { | 1365 if (last_keyword_ != keyword) { |
| 1365 last_keyword_ = keyword; | 1366 last_keyword_ = keyword; |
| 1366 | 1367 |
| 1367 if (is_extension_keyword) { | 1368 if (is_extension_keyword) { |
| 1368 const TemplateURL* template_url = | 1369 const TemplateURL* template_url = |
| 1369 template_url_service->GetTemplateURLForKeyword(keyword); | 1370 template_url_service->GetTemplateURLForKeyword(keyword); |
| 1370 gfx::Image image = profile->GetExtensionService()-> | 1371 gfx::Image image = extensions::OmniboxAPI::Get(profile)-> |
| 1371 GetOmniboxIcon(template_url->GetExtensionId()); | 1372 GetOmniboxIcon(template_url->GetExtensionId()); |
| 1372 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), | 1373 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), |
| 1373 image.ToGdkPixbuf()); | 1374 image.ToGdkPixbuf()); |
| 1374 } else { | 1375 } else { |
| 1375 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 1376 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 1376 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), | 1377 gtk_image_set_from_pixbuf(GTK_IMAGE(tab_to_search_magnifier_), |
| 1377 rb.GetNativeImageNamed(IDR_OMNIBOX_SEARCH).ToGdkPixbuf()); | 1378 rb.GetNativeImageNamed(IDR_OMNIBOX_SEARCH).ToGdkPixbuf()); |
| 1378 } | 1379 } |
| 1379 } | 1380 } |
| 1380 } | 1381 } |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 } | 2184 } |
| 2184 | 2185 |
| 2185 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2186 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2186 ExtensionAction* action) { | 2187 ExtensionAction* action) { |
| 2187 ExtensionPopupGtk::Show( | 2188 ExtensionPopupGtk::Show( |
| 2188 action->GetPopupUrl(current_tab_id_), | 2189 action->GetPopupUrl(current_tab_id_), |
| 2189 owner_->browser_, | 2190 owner_->browser_, |
| 2190 event_box_.get(), | 2191 event_box_.get(), |
| 2191 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2192 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2192 } | 2193 } |
| OLD | NEW |