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

Unified Diff: chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc

Issue 7740044: Implement fullscreen info bubble on Win and Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 9 years, 2 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
Index: chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
index 7437ffe5bbe5f4be504262644f57bc21d2573b0c..e18b65f0ccd770d15c23d4258e6f22b21f1fe900 100644
--- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
@@ -12,12 +12,17 @@
#include "ui/base/gtk/gtk_floating_container.h"
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/l10n/l10n_util.h"
+#include "chrome/browser/ui/browser.h"
tony 2011/10/13 22:34:39 Nit: sort header
koz (OOO until 15th September) 2011/10/14 00:35:16 Done.
FullscreenExitBubbleGtk::FullscreenExitBubbleGtk(
GtkFloatingContainer* container,
- CommandUpdater::CommandUpdaterDelegate* delegate)
- : FullscreenExitBubble(delegate),
- container_(container) {
+ Browser* browser,
+ const GURL& url,
+ bool ask_permission)
+ : FullscreenExitBubble(browser),
+ container_(container),
+ url_(url),
+ show_buttons_(ask_permission) {
InitWidgets();
StartWatchingMouse();
}
@@ -43,6 +48,27 @@ void FullscreenExitBubbleGtk::InitWidgets() {
FALSE);
signals_.Connect(link, "clicked", G_CALLBACK(OnLinkClickedThunk), this);
+ // hbox
tony 2011/10/13 22:34:39 Nit: I would remove this comment.
+ GtkWidget* hbox_ = gtk_hbox_new(FALSE, kPaddingPx);
+
+ gtk_box_pack_end(GTK_BOX(hbox_), link, FALSE, FALSE, 0);
+
+ if (show_buttons_) {
+ // Add buttons
tony 2011/10/13 22:34:39 Nit: This too, or make it more descriptive.
+ GtkWidget* deny_button = gtk_button_new_with_label("Deny");
tony 2011/10/13 22:34:39 Should this string be localized?
+ gtk_box_pack_end(GTK_BOX(hbox_), deny_button, FALSE, FALSE, 0);
+ GtkWidget* allow_button = gtk_button_new_with_label("Allow");
tony 2011/10/13 22:34:39 This too?
+ gtk_box_pack_end(GTK_BOX(hbox_), allow_button, FALSE, FALSE, 0);
tony 2011/10/13 22:34:39 Do we need to add any extra text here? It looks l
koz (OOO until 15th September) 2011/10/14 00:35:16 Yeah, the current plan is to do the plumbing for G
+
+ g_signal_connect(allow_button, "clicked",
+ G_CALLBACK(OnAllowClickedThunk),
+ this);
+
+ g_signal_connect(deny_button, "clicked",
+ G_CALLBACK(OnDenyClickedThunk),
+ this);
+ }
+
link_container_.Own(gtk_util::CreateGtkBorderBin(
link, &ui::kGdkBlack,
kPaddingPx, kPaddingPx, kPaddingPx, kPaddingPx));
@@ -138,3 +164,11 @@ void FullscreenExitBubbleGtk::OnSetFloatingPosition(
void FullscreenExitBubbleGtk::OnLinkClicked(GtkWidget* link) {
ToggleFullscreen();
}
+
+void FullscreenExitBubbleGtk::OnAllowClicked(GtkWidget* button) {
+ browser_->OnAcceptFullscreenPermission(url_);
+}
+
+void FullscreenExitBubbleGtk::OnDenyClicked(GtkWidget* button) {
+ ToggleFullscreen();
+}

Powered by Google App Engine
This is Rietveld 408576698