diff options
author | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 23:43:45 +0000 |
---|---|---|
committer | dhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 23:43:45 +0000 |
commit | 8ef47724cb5177e01b85e500bc8a8603874dc8cc (patch) | |
tree | 5b4656b6d493354ddd8e71387b06af965fec042c | |
parent | 9989005fee0c940b693fa0b18a94f5c85179b271 (diff) | |
download | chromium_src-8ef47724cb5177e01b85e500bc8a8603874dc8cc.zip chromium_src-8ef47724cb5177e01b85e500bc8a8603874dc8cc.tar.gz chromium_src-8ef47724cb5177e01b85e500bc8a8603874dc8cc.tar.bz2 |
Changing platform util for chromeos to open a gmail when the user clicks mailto
BUG=chromium-os:59
TEST=none
Review URL: http://codereview.chromium.org/2085004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47222 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/platform_util_chromeos.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/platform_util_chromeos.cc b/chrome/browser/platform_util_chromeos.cc index bc6e33e..1ca9cb3 100644 --- a/chrome/browser/platform_util_chromeos.cc +++ b/chrome/browser/platform_util_chromeos.cc @@ -22,6 +22,9 @@ class Profile; namespace platform_util { +static const std::string kGmailComposeUrl = + "https://mail.google.com/mail/?extsrc=mailto&url="; + // TODO(estade): It would be nice to be able to select the file in the file // manager, but that probably requires extending xdg-open. For now just // show the folder. @@ -79,8 +82,20 @@ void OpenItem(const FilePath& full_path) { } } -void OpenExternal(const GURL& url) { +static void OpenURL(const std::string& url) { + Browser* browser = BrowserList::GetLastActive(); + browser->AddTabWithURL( + GURL(url), GURL(), PageTransition::LINK, -1, Browser::ADD_SELECTED, + NULL, std::string()); +} +void OpenExternal(const GURL& url) { + if (url.SchemeIs("mailto")) { + std::string string_url = kGmailComposeUrl; + string_url.append(url.spec()); + ChromeThread::PostTask( + ChromeThread::UI, FROM_HERE, NewRunnableFunction(OpenURL, string_url)); + } } } // namespace platform_util |