| 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 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" | 71 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" |
| 72 #include "chrome/browser/ui/zoom/zoom_controller.h" | 72 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 73 #include "chrome/common/badge_util.h" | 73 #include "chrome/common/badge_util.h" |
| 74 #include "chrome/common/chrome_switches.h" | 74 #include "chrome/common/chrome_switches.h" |
| 75 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 75 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 76 #include "chrome/common/pref_names.h" | 76 #include "chrome/common/pref_names.h" |
| 77 #include "content/public/browser/navigation_entry.h" | 77 #include "content/public/browser/navigation_entry.h" |
| 78 #include "content/public/browser/notification_service.h" | 78 #include "content/public/browser/notification_service.h" |
| 79 #include "content/public/browser/web_contents.h" | 79 #include "content/public/browser/web_contents.h" |
| 80 #include "extensions/common/extension.h" | 80 #include "extensions/common/extension.h" |
| 81 #include "extensions/common/extension_set.h" |
| 81 #include "extensions/common/feature_switch.h" | 82 #include "extensions/common/feature_switch.h" |
| 82 #include "grit/generated_resources.h" | 83 #include "grit/generated_resources.h" |
| 83 #include "grit/theme_resources.h" | 84 #include "grit/theme_resources.h" |
| 84 #include "net/base/net_util.h" | 85 #include "net/base/net_util.h" |
| 85 #include "ui/base/accelerators/platform_accelerator_gtk.h" | 86 #include "ui/base/accelerators/platform_accelerator_gtk.h" |
| 86 #include "ui/base/accessibility/accessibility_types.h" | 87 #include "ui/base/accessibility/accessibility_types.h" |
| 87 #include "ui/base/dragdrop/gtk_dnd_util.h" | 88 #include "ui/base/dragdrop/gtk_dnd_util.h" |
| 88 #include "ui/base/gtk/gtk_hig_constants.h" | 89 #include "ui/base/gtk/gtk_hig_constants.h" |
| 89 #include "ui/base/gtk/gtk_signal_registrar.h" | 90 #include "ui/base/gtk/gtk_signal_registrar.h" |
| 90 #include "ui/base/l10n/l10n_util.h" | 91 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 1936 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 1936 ExtensionAction* action) { | 1937 ExtensionAction* action) { |
| 1937 ExtensionPopupGtk::Show( | 1938 ExtensionPopupGtk::Show( |
| 1938 action->GetPopupUrl(current_tab_id_), | 1939 action->GetPopupUrl(current_tab_id_), |
| 1939 owner_->browser_, | 1940 owner_->browser_, |
| 1940 event_box_.get(), | 1941 event_box_.get(), |
| 1941 ExtensionPopupGtk::SHOW_AND_INSPECT); | 1942 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 1942 } | 1943 } |
| 1943 | 1944 |
| 1944 void LocationBarViewGtk::PageActionViewGtk::ConnectPageActionAccelerator() { | 1945 void LocationBarViewGtk::PageActionViewGtk::ConnectPageActionAccelerator() { |
| 1945 const ExtensionSet* extensions = owner_->browser()->profile()-> | 1946 const extensions::ExtensionSet* extensions = |
| 1946 GetExtensionService()->extensions(); | 1947 owner_->browser()->profile()->GetExtensionService()->extensions(); |
| 1947 const Extension* extension = | 1948 const Extension* extension = |
| 1948 extensions->GetByID(page_action_->extension_id()); | 1949 extensions->GetByID(page_action_->extension_id()); |
| 1949 window_ = owner_->browser()->window()->GetNativeWindow(); | 1950 window_ = owner_->browser()->window()->GetNativeWindow(); |
| 1950 | 1951 |
| 1951 extensions::CommandService* command_service = | 1952 extensions::CommandService* command_service = |
| 1952 extensions::CommandService::Get(owner_->browser()->profile()); | 1953 extensions::CommandService::Get(owner_->browser()->profile()); |
| 1953 | 1954 |
| 1954 extensions::Command command_page_action; | 1955 extensions::Command command_page_action; |
| 1955 if (command_service->GetPageActionCommand( | 1956 if (command_service->GetPageActionCommand( |
| 1956 extension->id(), | 1957 extension->id(), |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 | 2124 |
| 2124 GdkEventButton event = {}; | 2125 GdkEventButton event = {}; |
| 2125 event.type = GDK_BUTTON_PRESS; | 2126 event.type = GDK_BUTTON_PRESS; |
| 2126 event.button = 1; | 2127 event.button = 1; |
| 2127 return view->OnButtonPressed(view->widget(), &event); | 2128 return view->OnButtonPressed(view->widget(), &event); |
| 2128 } | 2129 } |
| 2129 | 2130 |
| 2130 void LocationBarViewGtk::PageActionViewGtk::OnIconChanged() { | 2131 void LocationBarViewGtk::PageActionViewGtk::OnIconChanged() { |
| 2131 UpdateVisibility(owner_->GetWebContents(), current_url_); | 2132 UpdateVisibility(owner_->GetWebContents(), current_url_); |
| 2132 } | 2133 } |
| OLD | NEW |