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

Unified Diff: chrome/browser/gtk/location_bar_view_gtk.cc

Issue 159521: Implementation of the page info dialog on Linux Gtk. (Closed)
Patch Set: Fix build Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/location_bar_view_gtk.h ('k') | chrome/browser/gtk/page_info_window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc
index 8682c5ae58a3527c35e5dbade130bd60db4df2a2..f3a2618c069a56591b72f225d2a78d3e9e9d2952 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/gtk/location_bar_view_gtk.cc
@@ -15,6 +15,7 @@
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/alternate_nav_url_fetcher.h"
#include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h"
+#include "chrome/browser/browser_list.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/gtk/first_run_bubble.h"
#include "chrome/browser/gtk/gtk_theme_provider.h"
@@ -236,7 +237,16 @@ void LocationBarViewGtk::Init(bool popup_window_mode) {
kBottomMargin + kBorderThickness,
kSecurityIconPaddingLeft,
kSecurityIconPaddingRight);
- gtk_container_add(GTK_CONTAINER(security_icon_align_), security_icon_box);
+ // GtkImage is a "no window" widget and requires a GtkEventBox to receive
+ // events.
+ GtkWidget* event_box = gtk_event_box_new();
+ // Make the event box not visible so it does not paint a background.
+ gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box), FALSE);
+ g_signal_connect(event_box, "button-press-event",
+ G_CALLBACK(&OnSecurityIconPressed), this);
+
+ gtk_container_add(GTK_CONTAINER(event_box), security_icon_box);
+ gtk_container_add(GTK_CONTAINER(security_icon_align_), event_box);
gtk_box_pack_end(GTK_BOX(hbox_.get()), security_icon_align_, FALSE, FALSE, 0);
}
@@ -554,3 +564,18 @@ void LocationBarViewGtk::ShowFirstRunBubbleInternal(bool use_OEM_bubble) {
GTK_WINDOW(gtk_widget_get_toplevel(widget())),
gfx::Rect(x, y, 0, 0), use_OEM_bubble);
}
+
+// static
+gboolean LocationBarViewGtk::OnSecurityIconPressed(
+ GtkWidget* sender,
+ GdkEventButton* event,
+ LocationBarViewGtk* location_bar) {
+ TabContents* tab = BrowserList::GetLastActive()->GetSelectedTabContents();
+ NavigationEntry* nav_entry = tab->controller().GetActiveEntry();
+ if (!nav_entry) {
+ NOTREACHED();
+ return true;
+ }
+ tab->ShowPageInfo(nav_entry->url(), nav_entry->ssl(), true);
+ return true;
+}
« no previous file with comments | « chrome/browser/gtk/location_bar_view_gtk.h ('k') | chrome/browser/gtk/page_info_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698