Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 10544195: Show an extension info bubble when a script badge is clicked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" 50 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h"
51 #include "chrome/browser/ui/gtk/first_run_bubble.h" 51 #include "chrome/browser/ui/gtk/first_run_bubble.h"
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/omnibox/location_bar_util.h" 58 #include "chrome/browser/ui/omnibox/location_bar_util.h"
59 #include "chrome/browser/ui/tab_contents/tab_contents.h" 59 #include "chrome/browser/ui/tab_contents/tab_contents.h"
60 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h"
60 #include "chrome/common/chrome_notification_types.h" 61 #include "chrome/common/chrome_notification_types.h"
61 #include "chrome/common/extensions/extension.h" 62 #include "chrome/common/extensions/extension.h"
62 #include "chrome/common/extensions/extension_action.h" 63 #include "chrome/common/extensions/extension_action.h"
63 #include "chrome/common/extensions/extension_manifest_constants.h" 64 #include "chrome/common/extensions/extension_manifest_constants.h"
64 #include "chrome/common/extensions/extension_resource.h" 65 #include "chrome/common/extensions/extension_resource.h"
65 #include "chrome/common/pref_names.h" 66 #include "chrome/common/pref_names.h"
66 #include "content/public/browser/navigation_entry.h" 67 #include "content/public/browser/navigation_entry.h"
67 #include "content/public/browser/notification_service.h" 68 #include "content/public/browser/notification_service.h"
68 #include "content/public/browser/web_contents.h" 69 #include "content/public/browser/web_contents.h"
69 #include "grit/generated_resources.h" 70 #include "grit/generated_resources.h"
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 event_box_.get()); 1778 event_box_.get());
1778 break; 1779 break;
1779 1780
1780 case LocationBarController::ACTION_SHOW_CONTEXT_MENU: 1781 case LocationBarController::ACTION_SHOW_CONTEXT_MENU:
1781 context_menu_model_ = 1782 context_menu_model_ =
1782 new ExtensionContextMenuModel(extension, owner_->browser_); 1783 new ExtensionContextMenuModel(extension, owner_->browser_);
1783 context_menu_.reset( 1784 context_menu_.reset(
1784 new MenuGtk(NULL, context_menu_model_.get())); 1785 new MenuGtk(NULL, context_menu_model_.get()));
1785 context_menu_->PopupForWidget(sender, event->button, event->time); 1786 context_menu_->PopupForWidget(sender, event->button, event->time);
1786 break; 1787 break;
1788
1789 case LocationBarController::ACTION_SHOW_SCRIPT_POPUP:
1790 ExtensionPopupGtk::Show(
1791 ExtensionInfoUI::GetURL(extension->id()),
1792 owner_->browser_,
1793 event_box_.get());
1794 break;
1787 } 1795 }
1788 1796
1789 return TRUE; 1797 return TRUE;
1790 } 1798 }
1791 1799
1792 gboolean LocationBarViewGtk::PageActionViewGtk::OnExposeEvent( 1800 gboolean LocationBarViewGtk::PageActionViewGtk::OnExposeEvent(
1793 GtkWidget* widget, 1801 GtkWidget* widget,
1794 GdkEventExpose* event) { 1802 GdkEventExpose* event) {
1795 TRACE_EVENT0("ui::gtk", "LocationBarViewGtk::PageActionViewGtk::OnExpose"); 1803 TRACE_EVENT0("ui::gtk", "LocationBarViewGtk::PageActionViewGtk::OnExpose");
1796 WebContents* contents = owner_->GetWebContents(); 1804 WebContents* contents = owner_->GetWebContents();
(...skipping 27 matching lines...) Expand all
1824 GdkModifierType modifier, 1832 GdkModifierType modifier,
1825 void* user_data) { 1833 void* user_data) {
1826 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data); 1834 PageActionViewGtk* view = static_cast<PageActionViewGtk*>(user_data);
1827 if (!gtk_widget_get_visible(view->widget())) 1835 if (!gtk_widget_get_visible(view->widget()))
1828 return FALSE; 1836 return FALSE;
1829 1837
1830 GdkEventButton event = {}; 1838 GdkEventButton event = {};
1831 event.button = 1; 1839 event.button = 1;
1832 return view->OnButtonPressed(view->widget(), &event); 1840 return view->OnButtonPressed(view->widget(), &event);
1833 } 1841 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698