Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: chrome/browser/platform_util_chromeos.cc

Issue 10094012: Made File Manager respect the user-selected launch type (tab/pinned tab/window/fullscreen) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/platform_util_chromeos.cc
diff --git a/chrome/browser/platform_util_chromeos.cc b/chrome/browser/platform_util_chromeos.cc
index 5f3932d155484a634518b3ed1db58cdf23dae569..eaebafd1c823924b69dcd06f5403c3c1aa22422a 100644
--- a/chrome/browser/platform_util_chromeos.cc
+++ b/chrome/browser/platform_util_chromeos.cc
@@ -24,42 +24,13 @@ namespace {
const char kGmailComposeUrl[] =
"https://mail.google.com/mail/?extsrc=mailto&url=";
-void OpenFileBrowserOnUIThread(const FilePath& dir) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- Browser* browser = BrowserList::GetLastActive();
- if (!browser)
- return;
-
- FilePath virtual_path;
- if (!file_manager_util::ConvertFileToRelativeFileSystemPath(
- browser->profile(), dir, &virtual_path)) {
- return;
- }
-
- GURL url = file_manager_util::GetFileBrowserUrlWithParams(
- SelectFileDialog::SELECT_NONE, string16(), virtual_path, NULL, 0,
- FilePath::StringType());
- browser->ShowSingletonTab(url);
-}
-
-// file_util::DirectoryExists must be called on the FILE thread.
-void ShowItemInFolderOnFileThread(const FilePath& full_path) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- FilePath dir = full_path.DirName();
- if (file_util::DirectoryExists(dir)) {
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- base::Bind(&OpenFileBrowserOnUIThread, dir));
- }
-}
-
void OpenItemOnFileThread(const FilePath& full_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
base::Closure callback;
if (file_util::DirectoryExists(full_path))
callback = base::Bind(&file_manager_util::ViewFolder, full_path);
else
- callback = base::Bind(&file_manager_util::ViewFile, full_path, false);
+ callback = base::Bind(&file_manager_util::ViewFile, full_path);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
}
@@ -74,8 +45,7 @@ namespace platform_util {
void ShowItemInFolder(const FilePath& full_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
- base::Bind(&ShowItemInFolderOnFileThread, full_path));
+ file_manager_util::ShowFileInFolder(full_path);
}
void OpenItem(const FilePath& full_path) {

Powered by Google App Engine
This is Rietveld 408576698