diff options
author | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-01 22:32:26 +0000 |
---|---|---|
committer | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-01 22:32:26 +0000 |
commit | 59b2e326538d572e0a87c0cacc5335fc8c86a1f1 (patch) | |
tree | 0c0e04be0dca757ab7733706754136b6db77a6b6 /chrome/common/platform_util_mac.mm | |
parent | 23f1ef1a445a53bcefc8ddab9f4184b1db7321c5 (diff) | |
download | chromium_src-59b2e326538d572e0a87c0cacc5335fc8c86a1f1.zip chromium_src-59b2e326538d572e0a87c0cacc5335fc8c86a1f1.tar.gz chromium_src-59b2e326538d572e0a87c0cacc5335fc8c86a1f1.tar.bz2 |
Linux: handle external protocols, e.g. mailto: links.
BUG=20696
TEST=click a mailto: link, it should open your default MUA
Review URL: http://codereview.chromium.org/177040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/platform_util_mac.mm')
-rw-r--r-- | chrome/common/platform_util_mac.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/common/platform_util_mac.mm b/chrome/common/platform_util_mac.mm index b8787ea8..9c4cbe2 100644 --- a/chrome/common/platform_util_mac.mm +++ b/chrome/common/platform_util_mac.mm @@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/sys_string_conversions.h" #include "chrome/browser/cocoa/tab_window_controller.h" +#include "googleurl/src/gurl.h" #include "grit/generated_resources.h" namespace platform_util { @@ -28,6 +29,13 @@ void OpenItem(const FilePath& full_path) { [[NSWorkspace sharedWorkspace] openFile:path_string]; } +void OpenExternal(const GURL& url) { + DCHECK_EQ([NSThread currentThread], [NSThread mainThread]); + NSString* url_string = base::SysUTF8ToNSString(url.spec()); + NSURL* ns_url = [NSURL URLWithString:url_string]; + [[NSWorkspace sharedWorkspace] openURL:ns_url]; +} + gfx::NativeWindow GetTopLevel(gfx::NativeView view) { return [view window]; } |