diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 18:35:10 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 18:35:10 +0000 |
commit | d480bc80924732bfe029c894db68cecb15ce0a9f (patch) | |
tree | 063298145cedbcd6cac8fb8987b1e5b41416c45c /chrome/common/platform_util_mac.mm | |
parent | 878c426fd8ec9fc5568a7549d7cebad29db3413e (diff) | |
download | chromium_src-d480bc80924732bfe029c894db68cecb15ce0a9f.zip chromium_src-d480bc80924732bfe029c894db68cecb15ce0a9f.tar.gz chromium_src-d480bc80924732bfe029c894db68cecb15ce0a9f.tar.bz2 |
Fix DIR_SOURCE_ROOT to work in bundles like Chromium.app. Add more ui tests. Add a resource for tabs with no title on mac. Fix window title reporting. Remove the Browser dependency from the tab strip (only needs a TabStripModel).
Review URL: http://codereview.chromium.org/93025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/platform_util_mac.mm')
-rw-r--r-- | chrome/common/platform_util_mac.mm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/common/platform_util_mac.mm b/chrome/common/platform_util_mac.mm index 37cd39c..d61a50c9 100644 --- a/chrome/common/platform_util_mac.mm +++ b/chrome/common/platform_util_mac.mm @@ -9,6 +9,9 @@ #include "base/file_path.h" #include "base/logging.h" #include "base/sys_string_conversions.h" +#include "chrome/browser/cocoa/tab_window_controller.h" +#include "chrome/common/l10n_util.h" +#include "grit/chromium_strings.h" namespace platform_util { @@ -23,8 +26,17 @@ gfx::NativeWindow GetTopLevel(gfx::NativeView view) { } string16 GetWindowTitle(gfx::NativeWindow window) { - NOTIMPLEMENTED(); - return string16(); + NSString* title = nil; + if ([[window delegate] isKindOfClass:[TabWindowController class]]) + title = [[window delegate] selectedTabTitle]; + else + title = [window title]; + // If we don't yet have a title, use "Untitled". + if (![title length]) + return WideToUTF16(l10n_util::GetString( + IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED)); + + return base::SysNSStringToUTF16(title); } } // namespace platform_util |