OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/file_manager/open_util.h" | 5 #include "chrome/browser/chromeos/file_manager/open_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // We are executing the task on behalf of the file manager. | 92 // We are executing the task on behalf of the file manager. |
93 const GURL source_url = GetFileManagerMainPageUrl(); | 93 const GURL source_url = GetFileManagerMainPageUrl(); |
94 std::vector<FileSystemURL> urls; | 94 std::vector<FileSystemURL> urls; |
95 urls.push_back(file_system_context->CrackURL(url)); | 95 urls.push_back(file_system_context->CrackURL(url)); |
96 | 96 |
97 file_tasks::ExecuteFileTask( | 97 file_tasks::ExecuteFileTask( |
98 profile, | 98 profile, |
99 source_url, | 99 source_url, |
100 kFileManagerAppId, | 100 kFileManagerAppId, |
101 0, // no tab id | |
102 task, | 101 task, |
103 urls, | 102 urls, |
104 file_tasks::FileTaskFinishedCallback()); | 103 file_tasks::FileTaskFinishedCallback()); |
105 } | 104 } |
106 | 105 |
107 // Opens the file manager for the specified |file_path|. Used to implement | 106 // Opens the file manager for the specified |file_path|. Used to implement |
108 // internal handlers of special action IDs: | 107 // internal handlers of special action IDs: |
109 // | 108 // |
110 // "open" - Open the file manager for the given folder. | 109 // "open" - Open the file manager for the given folder. |
111 // "auto-open" - Open the file manager for the given removal drive and close | 110 // "auto-open" - Open the file manager for the given removal drive and close |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 base::Bind(&ContinueOpenItem, profile, file_path)); | 240 base::Bind(&ContinueOpenItem, profile, file_path)); |
242 } | 241 } |
243 | 242 |
244 void ShowItemInFolder(const base::FilePath& file_path) { | 243 void ShowItemInFolder(const base::FilePath& file_path) { |
245 // This action changes the selection so we do not reuse existing tabs. | 244 // This action changes the selection so we do not reuse existing tabs. |
246 OpenFileManagerWithInternalActionId(file_path, "select"); | 245 OpenFileManagerWithInternalActionId(file_path, "select"); |
247 } | 246 } |
248 | 247 |
249 } // namespace util | 248 } // namespace util |
250 } // namespace file_manager | 249 } // namespace file_manager |
OLD | NEW |