diff options
author | Iain Merrick <husky@google.com> | 2010-11-01 12:19:54 +0000 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-11-03 10:21:10 +0000 |
commit | 731df977c0511bca2206b5f333555b1205ff1f43 (patch) | |
tree | 0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/browser/platform_util_chromeos.cc | |
parent | 5add15e10e7bb80512f2c597ca57221314abe577 (diff) | |
download | external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.zip external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.gz external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.bz2 |
Merge Chromium at r63472 : Initial merge by git.
Change-Id: Ifb9ee821af006a5f2211e81471be93ae440a1f5a
Diffstat (limited to 'chrome/browser/platform_util_chromeos.cc')
-rw-r--r-- | chrome/browser/platform_util_chromeos.cc | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/chrome/browser/platform_util_chromeos.cc b/chrome/browser/platform_util_chromeos.cc index 2d70ef3..b8fd8e3 100644 --- a/chrome/browser/platform_util_chromeos.cc +++ b/chrome/browser/platform_util_chromeos.cc @@ -12,7 +12,7 @@ #include "base/task.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" -#include "chrome/browser/chrome_thread.h" +#include "chrome/browser/browser_thread.h" #include "chrome/browser/dom_ui/filebrowse_ui.h" #include "chrome/browser/dom_ui/mediaplayer_ui.h" #include "chrome/browser/tabs/tab_strip_model.h" @@ -29,7 +29,7 @@ static const std::string kGmailComposeUrl = // Opens file browser on UI thread. void OpenFileBrowserOnUIThread(const FilePath& dir) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Profile* profile; profile = BrowserList::GetLastActive()->profile(); @@ -48,11 +48,11 @@ void ShowItemInFolder(const FilePath& full_path) { if (!file_util::DirectoryExists(dir)) return; - if (ChromeThread::CurrentlyOn(ChromeThread::UI)) { + if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { OpenFileBrowserOnUIThread(dir); } else { - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(&OpenFileBrowserOnUIThread, dir)); } } @@ -71,17 +71,15 @@ void OpenItem(const FilePath& full_path) { std::string path; path = "file://"; path.append(full_path.value()); - if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { - bool result = ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { + bool result = BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(&OpenItem, full_path)); DCHECK(result); return; } Browser* browser = BrowserList::GetLastActive(); - browser->AddTabWithURL( - GURL(path), GURL(), PageTransition::LINK, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), NULL); + browser->AddSelectedTabWithURL(GURL(path), PageTransition::LINK); return; } if (ext == ".avi" || @@ -99,8 +97,8 @@ void OpenItem(const FilePath& full_path) { } // Unknwon file type. Show an error message to user. - ChromeThread::PostTask( - ChromeThread::UI, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction( &SimpleErrorBox, static_cast<gfx::NativeWindow>(NULL), @@ -112,17 +110,15 @@ void OpenItem(const FilePath& full_path) { static void OpenURL(const std::string& url) { Browser* browser = BrowserList::GetLastActive(); - browser->AddTabWithURL( - GURL(url), GURL(), PageTransition::LINK, -1, - TabStripModel::ADD_SELECTED, NULL, std::string(), NULL); + browser->AddSelectedTabWithURL(GURL(url), PageTransition::LINK); } 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)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, NewRunnableFunction(OpenURL, string_url)); } } |