Chromium Code Reviews| 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..414d1a21226547aeaf3b28688d820e317d99b1c3 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 *exit_link_text = l10n_util::GetNSString(IDS_EXIT_FULLSCREEN_MODE); |
|
Nico
2011/11/15 05:22:02
Space after *, not before. Variables in ObjC calle
jeremya
2011/11/15 05:29:13
Done.
|
| + NSString *accelerator_text = [@" " 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:accelerator_text |
| + withLink:exit_link_text |
| 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(textFrame.size.width); |
|
Nico
2011/11/15 05:22:02
NSWidth() on the right
jeremya
2011/11/15 05:29:13
Done.
|
| labelFrame.origin.x += NSWidth(labelFrame) - NSWidth(textFrame); |
| labelFrame.size = textFrame.size; |
| [exitLabel_ setFrame:labelFrame]; |