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

Side by Side Diff: chrome/browser/chromeos/file_manager/open_util.cc

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
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"
11 #include "chrome/browser/chromeos/drive/file_system_util.h" 11 #include "chrome/browser/chromeos/drive/file_system_util.h"
12 #include "chrome/browser/chromeos/file_manager/app_id.h" 12 #include "chrome/browser/chromeos/file_manager/app_id.h"
13 #include "chrome/browser/chromeos/file_manager/file_tasks.h" 13 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
14 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" 14 #include "chrome/browser/chromeos/file_manager/fileapi_util.h"
15 #include "chrome/browser/chromeos/file_manager/path_util.h" 15 #include "chrome/browser/chromeos/file_manager/path_util.h"
16 #include "chrome/browser/chromeos/file_manager/url_util.h" 16 #include "chrome/browser/chromeos/file_manager/url_util.h"
17 #include "chrome/browser/extensions/api/file_handlers/mime_util.h" 17 #include "chrome/browser/extensions/api/file_handlers/mime_util.h"
18 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/browser_finder.h" 19 #include "chrome/browser/ui/browser_finder.h"
20 #include "chrome/browser/ui/browser_window.h" 20 #include "chrome/browser/ui/browser_window.h"
21 #include "chrome/browser/ui/simple_message_box.h" 21 #include "chrome/browser/ui/simple_message_box.h"
22 #include "chrome/grit/generated_resources.h" 22 #include "chrome/grit/generated_resources.h"
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/user_metrics.h" 24 #include "content/public/browser/user_metrics.h"
25 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
26 #include "webkit/browser/fileapi/file_system_backend.h" 26 #include "storage/browser/fileapi/file_system_backend.h"
27 #include "webkit/browser/fileapi/file_system_context.h" 27 #include "storage/browser/fileapi/file_system_context.h"
28 #include "webkit/browser/fileapi/file_system_operation_runner.h" 28 #include "storage/browser/fileapi/file_system_operation_runner.h"
29 #include "webkit/browser/fileapi/file_system_url.h" 29 #include "storage/browser/fileapi/file_system_url.h"
30 30
31 using content::BrowserThread; 31 using content::BrowserThread;
32 using fileapi::FileSystemURL; 32 using storage::FileSystemURL;
33 33
34 namespace file_manager { 34 namespace file_manager {
35 namespace util { 35 namespace util {
36 namespace { 36 namespace {
37 37
38 // Shows a warning message box saying that the file could not be opened. 38 // Shows a warning message box saying that the file could not be opened.
39 void ShowWarningMessageBox(Profile* profile, 39 void ShowWarningMessageBox(Profile* profile,
40 const base::FilePath& file_path, 40 const base::FilePath& file_path,
41 int message_id) { 41 int message_id) {
42 Browser* browser = chrome::FindTabbedBrowser( 42 Browser* browser = chrome::FindTabbedBrowser(
43 profile, false, chrome::HOST_DESKTOP_TYPE_ASH); 43 profile, false, chrome::HOST_DESKTOP_TYPE_ASH);
44 chrome::ShowMessageBox( 44 chrome::ShowMessageBox(
45 browser ? browser->window()->GetNativeWindow() : NULL, 45 browser ? browser->window()->GetNativeWindow() : NULL,
46 l10n_util::GetStringFUTF16( 46 l10n_util::GetStringFUTF16(
47 IDS_FILE_BROWSER_ERROR_VIEWING_FILE_TITLE, 47 IDS_FILE_BROWSER_ERROR_VIEWING_FILE_TITLE,
48 base::UTF8ToUTF16(file_path.BaseName().AsUTF8Unsafe())), 48 base::UTF8ToUTF16(file_path.BaseName().AsUTF8Unsafe())),
49 l10n_util::GetStringUTF16(message_id), 49 l10n_util::GetStringUTF16(message_id),
50 chrome::MESSAGE_BOX_TYPE_WARNING); 50 chrome::MESSAGE_BOX_TYPE_WARNING);
51 } 51 }
52 52
53 // Executes the |task| for the file specified by |url|. 53 // Executes the |task| for the file specified by |url|.
54 void ExecuteFileTaskForUrl(Profile* profile, 54 void ExecuteFileTaskForUrl(Profile* profile,
55 const file_tasks::TaskDescriptor& task, 55 const file_tasks::TaskDescriptor& task,
56 const GURL& url) { 56 const GURL& url) {
57 fileapi::FileSystemContext* file_system_context = 57 storage::FileSystemContext* file_system_context =
58 GetFileSystemContextForExtensionId(profile, kFileManagerAppId); 58 GetFileSystemContextForExtensionId(profile, kFileManagerAppId);
59 59
60 file_tasks::ExecuteFileTask( 60 file_tasks::ExecuteFileTask(
61 profile, 61 profile,
62 GetFileManagerMainPageUrl(), // Executing the task on behalf of Files.app. 62 GetFileManagerMainPageUrl(), // Executing the task on behalf of Files.app.
63 task, 63 task,
64 std::vector<FileSystemURL>(1, file_system_context->CrackURL(url)), 64 std::vector<FileSystemURL>(1, file_system_context->CrackURL(url)),
65 file_tasks::FileTaskFinishedCallback()); 65 file_tasks::FileTaskFinishedCallback());
66 } 66 }
67 67
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 GURL url; 224 GURL url;
225 if (!ConvertPath(profile, file_path, &converted_path, &url)) 225 if (!ConvertPath(profile, file_path, &converted_path, &url))
226 return; 226 return;
227 227
228 // This action changes the selection so we do not reuse existing tabs. 228 // This action changes the selection so we do not reuse existing tabs.
229 OpenFileManagerWithInternalActionId(profile, url, "select"); 229 OpenFileManagerWithInternalActionId(profile, url, "select");
230 } 230 }
231 231
232 } // namespace util 232 } // namespace util
233 } // namespace file_manager 233 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/filesystem_api_util.cc ('k') | chrome/browser/chromeos/file_manager/snapshot_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698