| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 void LocationBarViewGtk::OnKillFocus() { | 809 void LocationBarViewGtk::OnKillFocus() { |
| 808 } | 810 } |
| 809 | 811 |
| 810 void LocationBarViewGtk::OnSetFocus() { | 812 void LocationBarViewGtk::OnSetFocus() { |
| 811 Profile* profile = browser_->profile(); | 813 Profile* profile = browser_->profile(); |
| 812 AccessibilityTextBoxInfo info( | 814 AccessibilityTextBoxInfo info( |
| 813 profile, | 815 profile, |
| 814 l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION), | 816 l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION), |
| 815 std::string(), | 817 std::string(), |
| 816 false); | 818 false); |
| 817 content::NotificationService::current()->Notify( | 819 ExtensionAccessibilityEventRouter::GetInstance()->HandleControlEvent( |
| 818 chrome::NOTIFICATION_ACCESSIBILITY_CONTROL_FOCUSED, | 820 ui::AccessibilityTypes::EVENT_FOCUS, |
| 819 content::Source<Profile>(profile), | 821 &info); |
| 820 content::Details<AccessibilityTextBoxInfo>(&info)); | |
| 821 | 822 |
| 822 // Update the keyword and search hint states. | 823 // Update the keyword and search hint states. |
| 823 OnChanged(); | 824 OnChanged(); |
| 824 } | 825 } |
| 825 | 826 |
| 826 gfx::Image LocationBarViewGtk::GetFavicon() const { | 827 gfx::Image LocationBarViewGtk::GetFavicon() const { |
| 827 return FaviconTabHelper::FromWebContents(GetWebContents())->GetFavicon(); | 828 return FaviconTabHelper::FromWebContents(GetWebContents())->GetFavicon(); |
| 828 } | 829 } |
| 829 | 830 |
| 830 string16 LocationBarViewGtk::GetTitle() const { | 831 string16 LocationBarViewGtk::GetTitle() const { |
| (...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 } | 2124 } |
| 2124 | 2125 |
| 2125 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2126 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2126 ExtensionAction* action) { | 2127 ExtensionAction* action) { |
| 2127 ExtensionPopupGtk::Show( | 2128 ExtensionPopupGtk::Show( |
| 2128 action->GetPopupUrl(current_tab_id_), | 2129 action->GetPopupUrl(current_tab_id_), |
| 2129 owner_->browser_, | 2130 owner_->browser_, |
| 2130 event_box_.get(), | 2131 event_box_.get(), |
| 2131 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2132 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2132 } | 2133 } |
| OLD | NEW |