summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
diff options
context:
space:
mode:
authorjeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 04:39:05 +0000
committerjeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 04:39:05 +0000
commit986722f73cd178705ff514b632b4eed72143c73b (patch)
treec8d6507689bfaae62ae7358effe9c31ca8f53ad7 /chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
parentb72828b12489e2b5bac7a974e59e113d7d1f969f (diff)
downloadchromium_src-986722f73cd178705ff514b632b4eed72143c73b.zip
chromium_src-986722f73cd178705ff514b632b4eed72143c73b.tar.gz
chromium_src-986722f73cd178705ff514b632b4eed72143c73b.tar.bz2
Fix up fullscreen exit bubble messages to suggest Esc instead of F11 where appropriate.
Mac: - Show "<link>Exit full screen</link> (Esc)". Since Mac only shows the bubble in tab fullscreen mode, it never needs to display the Cmd-Shift-F shortcut. Win, Linux: - Show "<link>Exit full screen (Esc)</link>". Will change it to match the mac message in a followup CL; this was easier for now. - Show "Press Esc to exit fullscreen" when mouse is locked. - Show "<link>Exit full screen (F11)</link>" when in browser fullscreen mode. BUG=99869 TEST=manual Review URL: http://codereview.chromium.org/8528052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc')
-rw-r--r--chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
index e77fc96..81404e8 100644
--- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc
@@ -56,7 +56,22 @@ void FullscreenExitBubbleGtk::UpdateContent(
UTF16ToUTF8(GetCurrentDenyButtonText()).c_str());
gtk_widget_show(deny_button_);
} else {
+ bool link_visible = true;
+ string16 accelerator;
if (bubble_type == FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION) {
+ accelerator = l10n_util::GetStringUTF16(IDS_APP_F11_KEY);
+ } else if (bubble_type == FEB_TYPE_FULLSCREEN_EXIT_INSTRUCTION) {
+ accelerator = l10n_util::GetStringUTF16(IDS_APP_ESC_KEY);
+ } else {
+ link_visible = false;
+ }
+ if (link_visible) {
+ std::string exit_link_text(
+ l10n_util::GetStringUTF8(IDS_EXIT_FULLSCREEN_MODE) + " " +
+ l10n_util::GetStringFUTF8(IDS_EXIT_FULLSCREEN_MODE_ACCELERATOR,
+ accelerator));
+ gtk_chrome_link_button_set_label(GTK_CHROME_LINK_BUTTON(link_),
+ exit_link_text.c_str());
gtk_widget_show(link_);
gtk_widget_hide(instruction_label_);
} else {
@@ -73,16 +88,6 @@ void FullscreenExitBubbleGtk::UpdateContent(
}
void FullscreenExitBubbleGtk::InitWidgets() {
- // The exit bubble is a gtk_chrome_link_button inside a gtk event box and gtk
- // alignment (these provide the background color). This is then made rounded
- // and put into a slide widget.
-
- // The Windows code actually looks up the accelerator key in the accelerator
- // table and then converts the key to a string (in a switch statement). This
- // doesn't seem to be implemented for Gtk, so we just use F11 directly.
- std::string exit_text_utf8(l10n_util::GetStringFUTF8(
- IDS_EXIT_FULLSCREEN_MODE, l10n_util::GetStringUTF16(IDS_APP_F11_KEY)));
-
hbox_ = gtk_hbox_new(false, ui::kControlSpacing);
message_label_ = gtk_label_new(GetMessage(url_).c_str());
@@ -100,18 +105,15 @@ void FullscreenExitBubbleGtk::InitWidgets() {
gtk_widget_set_no_show_all(deny_button_, FALSE);
gtk_box_pack_start(GTK_BOX(hbox_), deny_button_, FALSE, FALSE, 0);
- link_ = gtk_chrome_link_button_new(exit_text_utf8.c_str());
+ link_ = gtk_chrome_link_button_new("");
gtk_widget_set_can_focus(link_, FALSE);
gtk_widget_set_no_show_all(link_, FALSE);
gtk_chrome_link_button_set_use_gtk_theme(GTK_CHROME_LINK_BUTTON(link_),
FALSE);
gtk_box_pack_start(GTK_BOX(hbox_), link_, FALSE, FALSE, 0);
- instruction_label_ = gtk_chrome_link_button_new(
- UTF16ToUTF8(GetInstructionText()).c_str());
+ instruction_label_ = gtk_label_new(UTF16ToUTF8(GetInstructionText()).c_str());
gtk_widget_set_no_show_all(instruction_label_, FALSE);
- gtk_chrome_link_button_set_use_gtk_theme(
- GTK_CHROME_LINK_BUTTON(instruction_label_), FALSE);
gtk_box_pack_start(GTK_BOX(hbox_), instruction_label_, FALSE, FALSE, 0);
GtkWidget* bubble = gtk_util::CreateGtkBorderBin(
@@ -137,8 +139,6 @@ void FullscreenExitBubbleGtk::InitWidgets() {
signals_.Connect(container_, "set-floating-position",
G_CALLBACK(OnSetFloatingPositionThunk), this);
signals_.Connect(link_, "clicked", G_CALLBACK(OnLinkClickedThunk), this);
- signals_.Connect(instruction_label_, "clicked",
- G_CALLBACK(OnLinkClickedThunk), this);
signals_.Connect(allow_button_, "clicked",
G_CALLBACK(&OnAllowClickedThunk), this);
signals_.Connect(deny_button_, "clicked",