OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
6 | 6 |
7 #include "apps/browser/api/app_runtime/app_runtime_api.h" | 7 #include "apps/browser/api/app_runtime/app_runtime_api.h" |
8 #include "apps/browser/file_handler_util.h" | 8 #include "apps/browser/file_handler_util.h" |
9 #include "apps/common/api/app_runtime.h" | 9 #include "apps/common/api/app_runtime.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
41 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" | 41 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" |
42 #include "chrome/browser/chromeos/login/users/user_manager.h" | 42 #include "chrome/browser/chromeos/login/users/user_manager.h" |
43 #endif | 43 #endif |
44 | 44 |
45 namespace app_runtime = apps::api::app_runtime; | 45 namespace app_runtime = apps::api::app_runtime; |
46 | 46 |
47 using apps::file_handler_util::GrantedFileEntry; | 47 using apps::file_handler_util::GrantedFileEntry; |
48 using content::BrowserThread; | 48 using content::BrowserThread; |
49 using extensions::app_file_handler_util::CheckWritableFiles; | 49 using extensions::app_file_handler_util::PrepareFilesForWritableApp; |
50 using extensions::app_file_handler_util::FileHandlerForId; | 50 using extensions::app_file_handler_util::FileHandlerForId; |
51 using extensions::app_file_handler_util::FileHandlerCanHandleFile; | 51 using extensions::app_file_handler_util::FileHandlerCanHandleFile; |
52 using extensions::app_file_handler_util::FirstFileHandlerForFile; | 52 using extensions::app_file_handler_util::FirstFileHandlerForFile; |
53 using extensions::app_file_handler_util::CreateFileEntry; | 53 using extensions::app_file_handler_util::CreateFileEntry; |
54 using extensions::app_file_handler_util::HasFileSystemWritePermission; | 54 using extensions::app_file_handler_util::HasFileSystemWritePermission; |
55 using extensions::EventRouter; | 55 using extensions::EventRouter; |
56 using extensions::Extension; | 56 using extensions::Extension; |
57 using extensions::ExtensionHost; | 57 using extensions::ExtensionHost; |
58 using extensions::ExtensionSystem; | 58 using extensions::ExtensionSystem; |
59 | 59 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (file_path_.empty()) { | 107 if (file_path_.empty()) { |
108 LaunchPlatformAppWithNoData(profile_, extension_); | 108 LaunchPlatformAppWithNoData(profile_, extension_); |
109 return; | 109 return; |
110 } | 110 } |
111 | 111 |
112 DCHECK(file_path_.IsAbsolute()); | 112 DCHECK(file_path_.IsAbsolute()); |
113 | 113 |
114 if (HasFileSystemWritePermission(extension_)) { | 114 if (HasFileSystemWritePermission(extension_)) { |
115 std::vector<base::FilePath> paths; | 115 std::vector<base::FilePath> paths; |
116 paths.push_back(file_path_); | 116 paths.push_back(file_path_); |
117 CheckWritableFiles( | 117 PrepareFilesForWritableApp( |
118 paths, | 118 paths, |
119 profile_, | 119 profile_, |
120 false, | 120 false, |
121 base::Bind(&PlatformAppPathLauncher::OnFileValid, this), | 121 base::Bind(&PlatformAppPathLauncher::OnFileValid, this), |
122 base::Bind(&PlatformAppPathLauncher::OnFileInvalid, this)); | 122 base::Bind(&PlatformAppPathLauncher::OnFileInvalid, this)); |
123 return; | 123 return; |
124 } | 124 } |
125 | 125 |
126 OnFileValid(); | 126 OnFileValid(); |
127 } | 127 } |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 void LaunchPlatformAppWithUrl(Profile* profile, | 404 void LaunchPlatformAppWithUrl(Profile* profile, |
405 const Extension* extension, | 405 const Extension* extension, |
406 const std::string& handler_id, | 406 const std::string& handler_id, |
407 const GURL& url, | 407 const GURL& url, |
408 const GURL& referrer_url) { | 408 const GURL& referrer_url) { |
409 AppEventRouter::DispatchOnLaunchedEventWithUrl( | 409 AppEventRouter::DispatchOnLaunchedEventWithUrl( |
410 profile, extension, handler_id, url, referrer_url); | 410 profile, extension, handler_id, url, referrer_url); |
411 } | 411 } |
412 | 412 |
413 } // namespace apps | 413 } // namespace apps |
OLD | NEW |