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

Unified Diff: chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm

Issue 8528052: Fix up fullscreen exit bubble messages to suggest Esc instead of F11 where appropriate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove irrelevant test Created 9 years, 1 month 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/cocoa/fullscreen_exit_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
index fade662d9be98b7286eb31f3b1e41e0c298f9937..9a02086b6d97dc95d8547da3892766c8ba73f91b 100644
--- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
@@ -19,10 +19,12 @@
#import "chrome/browser/ui/cocoa/info_bubble_window.h"
#include "chrome/browser/ui/fullscreen_exit_bubble_type.h"
#include "grit/generated_resources.h"
+#include "grit/ui_strings.h"
#include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
#import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
#include "ui/base/models/accelerator_cocoa.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
@@ -166,6 +168,7 @@ const float kHideDuration = 0.7;
// Only button-less bubbles auto-hide.
[self hideSoon];
}
+ // TODO(jeremya): show "Press Esc to exit" instead of a link on mouselock.
// Relayout. A bit jumpy, but functional.
[tweaker_ tweakUI:[self window]];
@@ -237,14 +240,16 @@ const float kHideDuration = 0.7;
exitLabelPlaceholder_ = nil; // Now released.
[exitLabel_.get() setDelegate:self];
- NSString *message = l10n_util::GetNSStringF(IDS_EXIT_FULLSCREEN_MODE,
- base::SysNSStringToUTF16([[self class] keyCommandString]));
+ NSString* exitLinkText = l10n_util::GetNSString(IDS_EXIT_FULLSCREEN_MODE);
+ NSString* acceleratorText = [@" " stringByAppendingString:
+ l10n_util::GetNSStringF(IDS_EXIT_FULLSCREEN_MODE_ACCELERATOR,
+ l10n_util::GetStringUTF16(IDS_APP_ESC_KEY))];
NSFont* font = [NSFont systemFontOfSize:
[NSFont systemFontSizeForControlSize:NSRegularControlSize]];
[(HyperlinkTextView*)exitLabel_.get()
- setMessageAndLink:@""
- withLink:message
+ setMessageAndLink:acceleratorText
+ withLink:exitLinkText
atOffset:0
font:font
messageColor:[NSColor blackColor]
@@ -262,6 +267,7 @@ const float kHideDuration = 0.7;
[layoutManager ensureLayoutForTextContainer:textContainer];
NSRect textFrame = [layoutManager usedRectForTextContainer:textContainer];
+ textFrame.size.width = ceil(NSWidth(textFrame));
labelFrame.origin.x += NSWidth(labelFrame) - NSWidth(textFrame);
labelFrame.size = textFrame.size;
[exitLabel_ setFrame:labelFrame];
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698