| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 52 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 53 #include "chrome/browser/ui/gtk/gtk_util.h" | 53 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 54 #include "chrome/browser/ui/gtk/nine_box.h" | 54 #include "chrome/browser/ui/gtk/nine_box.h" |
| 55 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" | 55 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" |
| 56 #include "chrome/browser/ui/gtk/rounded_window.h" | 56 #include "chrome/browser/ui/gtk/rounded_window.h" |
| 57 #include "chrome/browser/ui/gtk/view_id_util.h" | 57 #include "chrome/browser/ui/gtk/view_id_util.h" |
| 58 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" | 58 #include "chrome/browser/ui/gtk/zoom_bubble_gtk.h" |
| 59 #include "chrome/browser/ui/omnibox/location_bar_util.h" | 59 #include "chrome/browser/ui/omnibox/location_bar_util.h" |
| 60 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 60 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| 61 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 61 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 62 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" |
| 62 #include "chrome/browser/ui/zoom/zoom_controller.h" | 63 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 63 #include "chrome/common/chrome_notification_types.h" | 64 #include "chrome/common/chrome_notification_types.h" |
| 64 #include "chrome/common/extensions/extension.h" | 65 #include "chrome/common/extensions/extension.h" |
| 65 #include "chrome/common/extensions/extension_action.h" | 66 #include "chrome/common/extensions/extension_action.h" |
| 66 #include "chrome/common/extensions/extension_manifest_constants.h" | 67 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 67 #include "chrome/common/extensions/extension_resource.h" | 68 #include "chrome/common/extensions/extension_resource.h" |
| 68 #include "chrome/common/pref_names.h" | 69 #include "chrome/common/pref_names.h" |
| 69 #include "content/public/browser/navigation_entry.h" | 70 #include "content/public/browser/navigation_entry.h" |
| 70 #include "content/public/browser/notification_service.h" | 71 #include "content/public/browser/notification_service.h" |
| 71 #include "content/public/browser/web_contents.h" | 72 #include "content/public/browser/web_contents.h" |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 ExtensionPopupGtk::SHOW); | 1884 ExtensionPopupGtk::SHOW); |
| 1884 break; | 1885 break; |
| 1885 | 1886 |
| 1886 case LocationBarController::ACTION_SHOW_CONTEXT_MENU: | 1887 case LocationBarController::ACTION_SHOW_CONTEXT_MENU: |
| 1887 context_menu_model_ = | 1888 context_menu_model_ = |
| 1888 new ExtensionContextMenuModel(extension, owner_->browser_, this); | 1889 new ExtensionContextMenuModel(extension, owner_->browser_, this); |
| 1889 context_menu_.reset( | 1890 context_menu_.reset( |
| 1890 new MenuGtk(NULL, context_menu_model_.get())); | 1891 new MenuGtk(NULL, context_menu_model_.get())); |
| 1891 context_menu_->PopupForWidget(sender, event->button, event->time); | 1892 context_menu_->PopupForWidget(sender, event->button, event->time); |
| 1892 break; | 1893 break; |
| 1894 |
| 1895 case LocationBarController::ACTION_SHOW_SCRIPT_POPUP: |
| 1896 ExtensionPopupGtk::Show( |
| 1897 ExtensionInfoUI::GetURL(extension->id()), |
| 1898 owner_->browser_, |
| 1899 event_box_.get(), |
| 1900 ExtensionPopupGtk::SHOW); |
| 1901 break; |
| 1893 } | 1902 } |
| 1894 | 1903 |
| 1895 return TRUE; | 1904 return TRUE; |
| 1896 } | 1905 } |
| 1897 | 1906 |
| 1898 gboolean LocationBarViewGtk::PageActionViewGtk::OnExposeEvent( | 1907 gboolean LocationBarViewGtk::PageActionViewGtk::OnExposeEvent( |
| 1899 GtkWidget* widget, | 1908 GtkWidget* widget, |
| 1900 GdkEventExpose* event) { | 1909 GdkEventExpose* event) { |
| 1901 TRACE_EVENT0("ui::gtk", "LocationBarViewGtk::PageActionViewGtk::OnExpose"); | 1910 TRACE_EVENT0("ui::gtk", "LocationBarViewGtk::PageActionViewGtk::OnExpose"); |
| 1902 WebContents* contents = owner_->GetWebContents(); | 1911 WebContents* contents = owner_->GetWebContents(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 } | 1948 } |
| 1940 | 1949 |
| 1941 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 1950 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 1942 ExtensionAction* action) { | 1951 ExtensionAction* action) { |
| 1943 ExtensionPopupGtk::Show( | 1952 ExtensionPopupGtk::Show( |
| 1944 action->GetPopupUrl(current_tab_id_), | 1953 action->GetPopupUrl(current_tab_id_), |
| 1945 owner_->browser_, | 1954 owner_->browser_, |
| 1946 event_box_.get(), | 1955 event_box_.get(), |
| 1947 ExtensionPopupGtk::SHOW_AND_INSPECT); | 1956 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 1948 } | 1957 } |
| OLD | NEW |