| 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/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 22 #include "chrome/app/chrome_command_ids.h" | 22 #include "chrome/app/chrome_command_ids.h" |
| 23 #include "chrome/browser/accessibility/accessibility_events.h" | 23 #include "chrome/browser/accessibility/accessibility_events.h" |
| 24 #include "chrome/browser/accessibility/accessibility_extension_api.h" |
| 24 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
| 25 #include "chrome/browser/command_updater.h" | 26 #include "chrome/browser/command_updater.h" |
| 26 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 27 #include "chrome/browser/defaults.h" | 28 #include "chrome/browser/defaults.h" |
| 28 #include "chrome/browser/extensions/api/commands/command_service.h" | 29 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 29 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 30 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
| 30 #include "chrome/browser/extensions/extension_action.h" | 31 #include "chrome/browser/extensions/extension_action.h" |
| 31 #include "chrome/browser/extensions/extension_service.h" | 32 #include "chrome/browser/extensions/extension_service.h" |
| 32 #include "chrome/browser/extensions/extension_tab_util.h" | 33 #include "chrome/browser/extensions/extension_tab_util.h" |
| 33 #include "chrome/browser/extensions/location_bar_controller.h" | 34 #include "chrome/browser/extensions/location_bar_controller.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #include "chrome/common/extensions/feature_switch.h" | 76 #include "chrome/common/extensions/feature_switch.h" |
| 76 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 77 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 77 #include "chrome/common/pref_names.h" | 78 #include "chrome/common/pref_names.h" |
| 78 #include "content/public/browser/navigation_entry.h" | 79 #include "content/public/browser/navigation_entry.h" |
| 79 #include "content/public/browser/notification_service.h" | 80 #include "content/public/browser/notification_service.h" |
| 80 #include "content/public/browser/web_contents.h" | 81 #include "content/public/browser/web_contents.h" |
| 81 #include "grit/generated_resources.h" | 82 #include "grit/generated_resources.h" |
| 82 #include "grit/theme_resources.h" | 83 #include "grit/theme_resources.h" |
| 83 #include "net/base/net_util.h" | 84 #include "net/base/net_util.h" |
| 84 #include "ui/base/accelerators/platform_accelerator_gtk.h" | 85 #include "ui/base/accelerators/platform_accelerator_gtk.h" |
| 86 #include "ui/base/accessibility/accessibility_types.h" |
| 85 #include "ui/base/dragdrop/gtk_dnd_util.h" | 87 #include "ui/base/dragdrop/gtk_dnd_util.h" |
| 86 #include "ui/base/gtk/gtk_hig_constants.h" | 88 #include "ui/base/gtk/gtk_hig_constants.h" |
| 87 #include "ui/base/gtk/gtk_signal_registrar.h" | 89 #include "ui/base/gtk/gtk_signal_registrar.h" |
| 88 #include "ui/base/l10n/l10n_util.h" | 90 #include "ui/base/l10n/l10n_util.h" |
| 89 #include "ui/base/resource/resource_bundle.h" | 91 #include "ui/base/resource/resource_bundle.h" |
| 90 #include "ui/base/window_open_disposition.h" | 92 #include "ui/base/window_open_disposition.h" |
| 91 #include "ui/gfx/canvas_skia_paint.h" | 93 #include "ui/gfx/canvas_skia_paint.h" |
| 92 #include "ui/gfx/font.h" | 94 #include "ui/gfx/font.h" |
| 93 #include "ui/gfx/gtk_util.h" | 95 #include "ui/gfx/gtk_util.h" |
| 94 #include "ui/gfx/image/image.h" | 96 #include "ui/gfx/image/image.h" |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 void LocationBarViewGtk::OnKillFocus() { | 802 void LocationBarViewGtk::OnKillFocus() { |
| 801 } | 803 } |
| 802 | 804 |
| 803 void LocationBarViewGtk::OnSetFocus() { | 805 void LocationBarViewGtk::OnSetFocus() { |
| 804 Profile* profile = browser_->profile(); | 806 Profile* profile = browser_->profile(); |
| 805 AccessibilityTextBoxInfo info( | 807 AccessibilityTextBoxInfo info( |
| 806 profile, | 808 profile, |
| 807 l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION), | 809 l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION), |
| 808 std::string(), | 810 std::string(), |
| 809 false); | 811 false); |
| 810 content::NotificationService::current()->Notify( | 812 ExtensionAccessibilityEventRouter::GetInstance()->HandleControlEvent( |
| 811 chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, | 813 ui::AccessibilityTypes::EVENT_FOCUS, |
| 812 content::Source<Profile>(profile), | 814 &info); |
| 813 content::Details<AccessibilityTextBoxInfo>(&info)); | |
| 814 | 815 |
| 815 // Update the keyword and search hint states. | 816 // Update the keyword and search hint states. |
| 816 OnChanged(); | 817 OnChanged(); |
| 817 } | 818 } |
| 818 | 819 |
| 819 gfx::Image LocationBarViewGtk::GetFavicon() const { | 820 gfx::Image LocationBarViewGtk::GetFavicon() const { |
| 820 return FaviconTabHelper::FromWebContents(GetWebContents())->GetFavicon(); | 821 return FaviconTabHelper::FromWebContents(GetWebContents())->GetFavicon(); |
| 821 } | 822 } |
| 822 | 823 |
| 823 string16 LocationBarViewGtk::GetTitle() const { | 824 string16 LocationBarViewGtk::GetTitle() const { |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 } | 2118 } |
| 2118 | 2119 |
| 2119 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2120 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2120 ExtensionAction* action) { | 2121 ExtensionAction* action) { |
| 2121 ExtensionPopupGtk::Show( | 2122 ExtensionPopupGtk::Show( |
| 2122 action->GetPopupUrl(current_tab_id_), | 2123 action->GetPopupUrl(current_tab_id_), |
| 2123 owner_->browser_, | 2124 owner_->browser_, |
| 2124 event_box_.get(), | 2125 event_box_.get(), |
| 2125 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2126 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2126 } | 2127 } |
| OLD | NEW |