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

Side by Side Diff: chrome/browser/platform_util.cc

Issue 1867533002: (TOBEDELETED)Select downloaded file in the folder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/platform_util.h" 5 #include "chrome/browser/platform_util.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/platform_util_internal.h" 10 #include "chrome/browser/platform_util_internal.h"
(...skipping 10 matching lines...) Expand all
21 void VerifyAndOpenItemOnBlockingThread(const base::FilePath& path, 21 void VerifyAndOpenItemOnBlockingThread(const base::FilePath& path,
22 OpenItemType type, 22 OpenItemType type,
23 const OpenOperationCallback& callback) { 23 const OpenOperationCallback& callback) {
24 base::File target_item(path, base::File::FLAG_OPEN | base::File::FLAG_READ); 24 base::File target_item(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
25 if (!base::PathExists(path)) { 25 if (!base::PathExists(path)) {
26 if (!callback.is_null()) 26 if (!callback.is_null())
27 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 27 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
28 base::Bind(callback, OPEN_FAILED_PATH_NOT_FOUND)); 28 base::Bind(callback, OPEN_FAILED_PATH_NOT_FOUND));
29 return; 29 return;
30 } 30 }
31 if (base::DirectoryExists(path) != (type == OPEN_FOLDER)) { 31 if (base::DirectoryExists(path)) {
Evan Stade 2016/04/07 16:58:58 why this change?
maksims (do not use this acc) 2016/04/14 08:30:33 Because OpenItem() function used to send path.DirN
Lei Zhang 2016/04/15 01:39:24 Sorry, but VerifyAndOpenItemOnBlockingThread(), ba
32 if (!callback.is_null()) 32 if (!callback.is_null())
33 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 33 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
34 base::Bind(callback, OPEN_FAILED_INVALID_TYPE)); 34 base::Bind(callback, OPEN_FAILED_INVALID_TYPE));
35 return; 35 return;
36 } 36 }
37 37
38 if (shell_operations_allowed) 38 if (shell_operations_allowed)
39 internal::PlatformOpenVerifiedItem(path, type); 39 internal::PlatformOpenVerifiedItem(path, type);
40 if (!callback.is_null()) 40 if (!callback.is_null())
41 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 41 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
(...skipping 14 matching lines...) Expand all
56 const base::FilePath& full_path, 56 const base::FilePath& full_path,
57 OpenItemType item_type, 57 OpenItemType item_type,
58 const OpenOperationCallback& callback) { 58 const OpenOperationCallback& callback) {
59 DCHECK_CURRENTLY_ON(BrowserThread::UI); 59 DCHECK_CURRENTLY_ON(BrowserThread::UI);
60 BrowserThread::PostBlockingPoolTask( 60 BrowserThread::PostBlockingPoolTask(
61 FROM_HERE, base::Bind(&VerifyAndOpenItemOnBlockingThread, full_path, 61 FROM_HERE, base::Bind(&VerifyAndOpenItemOnBlockingThread, full_path,
62 item_type, callback)); 62 item_type, callback));
63 } 63 }
64 64
65 } // namespace platform_util 65 } // namespace platform_util
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/platform_util_linux.cc » ('j') | chrome/browser/platform_util_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698