[email protected] | 24c81d69 | 2013-08-07 14:09:48 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 24c81d69 | 2013-08-07 14:09:48 | [diff] [blame] | 5 | #include "apps/launcher.h" |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 6 | |
mostynb | ecb4a22b | 2016-04-04 06:08:01 | [diff] [blame] | 7 | #include <memory> |
[email protected] | fc243fe | 2014-07-18 13:06:23 | [diff] [blame] | 8 | #include <set> |
[email protected] | 4d39078 | 2014-08-15 09:22:58 | [diff] [blame] | 9 | #include <utility> |
[email protected] | fc243fe | 2014-07-18 13:06:23 | [diff] [blame] | 10 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 11 | #include "base/command_line.h" |
[email protected] | 5799981 | 2013-02-24 05:40:52 | [diff] [blame] | 12 | #include "base/files/file_path.h" |
thestig | 9471270 | 2014-09-10 07:46:59 | [diff] [blame] | 13 | #include "base/files/file_util.h" |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 14 | #include "base/logging.h" |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 15 | #include "base/memory/ptr_util.h" |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 16 | #include "base/memory/ref_counted.h" |
[email protected] | 46acbf1 | 2013-06-10 18:43:42 | [diff] [blame] | 17 | #include "base/strings/string_util.h" |
[email protected] | 112158af | 2013-06-07 23:46:18 | [diff] [blame] | 18 | #include "base/strings/utf_string_conversions.h" |
Michael Giuffrida | fc9947e | 2017-07-26 09:37:47 | [diff] [blame^] | 19 | #include "base/task_scheduler/post_task.h" |
| 20 | #include "base/task_scheduler/task_traits.h" |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 21 | #include "content/public/browser/browser_context.h" |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 22 | #include "content/public/browser/browser_thread.h" |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 23 | #include "content/public/browser/render_process_host.h" |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 24 | #include "content/public/browser/web_contents.h" |
[email protected] | 4c35abc | 2014-05-14 02:13:58 | [diff] [blame] | 25 | #include "content/public/common/content_switches.h" |
| 26 | #include "content/public/common/url_constants.h" |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 27 | #include "extensions/browser/api/app_runtime/app_runtime_api.h" |
michaelpg | bc6e379f | 2017-02-13 23:17:27 | [diff] [blame] | 28 | #include "extensions/browser/api/file_handlers/app_file_handler_util.h" |
| 29 | #include "extensions/browser/api/file_handlers/directory_util.h" |
| 30 | #include "extensions/browser/api/file_handlers/mime_util.h" |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 31 | #include "extensions/browser/entry_info.h" |
[email protected] | 3442353 | 2013-11-21 18:13:10 | [diff] [blame] | 32 | #include "extensions/browser/event_router.h" |
[email protected] | 22401dc | 2014-03-21 01:38:57 | [diff] [blame] | 33 | #include "extensions/browser/extension_host.h" |
[email protected] | 489db084 | 2014-01-22 18:20:03 | [diff] [blame] | 34 | #include "extensions/browser/extension_prefs.h" |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 35 | #include "extensions/browser/extension_registry.h" |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 36 | #include "extensions/browser/granted_file_entry.h" |
[email protected] | 9fe4204 | 2013-10-29 21:13:33 | [diff] [blame] | 37 | #include "extensions/browser/lazy_background_task_queue.h" |
[email protected] | 98b6d94 | 2013-11-10 00:34:07 | [diff] [blame] | 38 | #include "extensions/browser/process_manager.h" |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 39 | #include "extensions/common/api/app_runtime.h" |
[email protected] | e4452d3 | 2013-11-15 23:07:41 | [diff] [blame] | 40 | #include "extensions/common/extension.h" |
[email protected] | 70c39bb | 2013-11-26 22:59:28 | [diff] [blame] | 41 | #include "extensions/common/manifest_handlers/kiosk_mode_info.h" |
tbarzic | 8bf50fca | 2017-06-22 03:02:18 | [diff] [blame] | 42 | #include "extensions/common/permissions/api_permission.h" |
| 43 | #include "extensions/common/permissions/permissions_data.h" |
[email protected] | f7fc72c | 2014-04-22 13:01:52 | [diff] [blame] | 44 | #include "net/base/filename_util.h" |
[email protected] | 43197ea2 | 2013-09-10 15:31:56 | [diff] [blame] | 45 | #include "url/gurl.h" |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 46 | |
[email protected] | 906ae21 | 2013-03-24 01:37:13 | [diff] [blame] | 47 | #if defined(OS_CHROMEOS) |
[email protected] | 4d39078 | 2014-08-15 09:22:58 | [diff] [blame] | 48 | #include "components/user_manager/user_manager.h" |
[email protected] | 906ae21 | 2013-03-24 01:37:13 | [diff] [blame] | 49 | #endif |
| 50 | |
kalman | e58e6223 | 2015-07-23 18:27:22 | [diff] [blame] | 51 | namespace app_runtime = extensions::api::app_runtime; |
[email protected] | e054ea1 | 2013-08-20 00:41:57 | [diff] [blame] | 52 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 53 | using content::BrowserThread; |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 54 | using extensions::AppRuntimeEventRouter; |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 55 | using extensions::api::app_runtime::PlayStoreStatus; |
[email protected] | fc2a40f | 2013-03-13 13:14:57 | [diff] [blame] | 56 | using extensions::app_file_handler_util::CreateFileEntry; |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 57 | using extensions::app_file_handler_util::FileHandlerCanHandleEntry; |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 58 | using extensions::app_file_handler_util::FileHandlerForId; |
[email protected] | ffb8706 | 2013-08-29 10:02:25 | [diff] [blame] | 59 | using extensions::app_file_handler_util::HasFileSystemWritePermission; |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 60 | using extensions::app_file_handler_util::PrepareFilesForWritableApp; |
[email protected] | 3a368a2 | 2014-03-26 19:29:19 | [diff] [blame] | 61 | using extensions::EventRouter; |
[email protected] | 24c81d69 | 2013-08-07 14:09:48 | [diff] [blame] | 62 | using extensions::Extension; |
| 63 | using extensions::ExtensionHost; |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 64 | using extensions::GrantedFileEntry; |
[email protected] | d9ede58 | 2012-08-14 19:21:38 | [diff] [blame] | 65 | |
[email protected] | 24c81d69 | 2013-08-07 14:09:48 | [diff] [blame] | 66 | namespace apps { |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 67 | |
| 68 | namespace { |
| 69 | |
[email protected] | 9be0bad | 2013-04-18 05:51:36 | [diff] [blame] | 70 | const char kFallbackMimeType[] = "application/octet-stream"; |
| 71 | |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 72 | bool DoMakePathAbsolute(const base::FilePath& current_directory, |
| 73 | base::FilePath* file_path) { |
[email protected] | a5a0be0 | 2012-07-18 05:51:54 | [diff] [blame] | 74 | DCHECK(file_path); |
| 75 | if (file_path->IsAbsolute()) |
| 76 | return true; |
| 77 | |
[email protected] | 1547693 | 2013-04-12 05:17:15 | [diff] [blame] | 78 | if (current_directory.empty()) { |
kinaba | 6e0570b | 2014-10-21 05:43:34 | [diff] [blame] | 79 | base::FilePath absolute_path = base::MakeAbsoluteFilePath(*file_path); |
| 80 | if (absolute_path.empty()) |
| 81 | return false; |
| 82 | *file_path = absolute_path; |
| 83 | return true; |
[email protected] | 1547693 | 2013-04-12 05:17:15 | [diff] [blame] | 84 | } |
[email protected] | a5a0be0 | 2012-07-18 05:51:54 | [diff] [blame] | 85 | |
| 86 | if (!current_directory.IsAbsolute()) |
| 87 | return false; |
| 88 | |
| 89 | *file_path = current_directory.Append(*file_path); |
| 90 | return true; |
| 91 | } |
| 92 | |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 93 | // Class to handle launching of platform apps to open specific paths. |
[email protected] | 4e04f1e | 2012-06-20 03:20:31 | [diff] [blame] | 94 | // An instance of this class is created for each launch. The lifetime of these |
| 95 | // instances is managed by reference counted pointers. As long as an instance |
| 96 | // has outstanding tasks on a message queue it will be retained; once all |
| 97 | // outstanding tasks are completed it will be deleted. |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 98 | class PlatformAppPathLauncher |
| 99 | : public base::RefCountedThreadSafe<PlatformAppPathLauncher> { |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 100 | public: |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 101 | PlatformAppPathLauncher(content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 102 | const Extension* app, |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 103 | const std::vector<base::FilePath>& entry_paths) |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 104 | : context_(context), |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 105 | extension_id(app->id()), |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 106 | entry_paths_(entry_paths), |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 107 | mime_type_collector_(context), |
| 108 | is_directory_collector_(context) {} |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 109 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 110 | PlatformAppPathLauncher(content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 111 | const Extension* app, |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 112 | const base::FilePath& file_path) |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 113 | : context_(context), |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 114 | extension_id(app->id()), |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 115 | mime_type_collector_(context), |
| 116 | is_directory_collector_(context) { |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 117 | if (!file_path.empty()) |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 118 | entry_paths_.push_back(file_path); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 119 | } |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 120 | |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 121 | void set_action_data(std::unique_ptr<app_runtime::ActionData> action_data) { |
| 122 | action_data_ = std::move(action_data); |
| 123 | } |
| 124 | |
| 125 | void set_launch_source(extensions::AppLaunchSource launch_source) { |
| 126 | launch_source_ = launch_source; |
| 127 | } |
| 128 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 129 | void Launch() { |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 130 | DCHECK_CURRENTLY_ON(BrowserThread::UI); |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 131 | |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 132 | const Extension* app = GetExtension(); |
| 133 | if (!app) |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 134 | return; |
| 135 | |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 136 | if (entry_paths_.empty()) { |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 137 | LaunchWithNoLaunchData(); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 138 | return; |
| 139 | } |
| 140 | |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 141 | for (size_t i = 0; i < entry_paths_.size(); ++i) { |
| 142 | DCHECK(entry_paths_[i].IsAbsolute()); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 143 | } |
[email protected] | 906ae21 | 2013-03-24 01:37:13 | [diff] [blame] | 144 | |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 145 | is_directory_collector_.CollectForEntriesPaths( |
| 146 | entry_paths_, |
| 147 | base::Bind(&PlatformAppPathLauncher::OnAreDirectoriesCollected, this, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 148 | HasFileSystemWritePermission(app))); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 149 | } |
| 150 | |
[email protected] | af8dc08e | 2012-11-22 01:58:42 | [diff] [blame] | 151 | void LaunchWithHandler(const std::string& handler_id) { |
| 152 | handler_id_ = handler_id; |
| 153 | Launch(); |
| 154 | } |
| 155 | |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 156 | void LaunchWithRelativePath(const base::FilePath& current_directory) { |
Michael Giuffrida | fc9947e | 2017-07-26 09:37:47 | [diff] [blame^] | 157 | base::PostTaskWithTraits( |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 158 | FROM_HERE, |
Michael Giuffrida | fc9947e | 2017-07-26 09:37:47 | [diff] [blame^] | 159 | {base::TaskPriority::USER_VISIBLE, base::MayBlock(), |
| 160 | base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, |
| 161 | base::Bind(&PlatformAppPathLauncher::MakePathAbsolute, this, |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 162 | current_directory)); |
| 163 | } |
| 164 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 165 | private: |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 166 | friend class base::RefCountedThreadSafe<PlatformAppPathLauncher>; |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 167 | |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 168 | virtual ~PlatformAppPathLauncher() {} |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 169 | |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 170 | void MakePathAbsolute(const base::FilePath& current_directory) { |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 171 | for (std::vector<base::FilePath>::iterator it = entry_paths_.begin(); |
| 172 | it != entry_paths_.end(); ++it) { |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 173 | if (!DoMakePathAbsolute(current_directory, &*it)) { |
| 174 | LOG(WARNING) << "Cannot make absolute path from " << it->value(); |
| 175 | BrowserThread::PostTask( |
| 176 | BrowserThread::UI, |
| 177 | FROM_HERE, |
| 178 | base::Bind(&PlatformAppPathLauncher::LaunchWithNoLaunchData, this)); |
| 179 | return; |
| 180 | } |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | BrowserThread::PostTask(BrowserThread::UI, |
| 184 | FROM_HERE, |
| 185 | base::Bind(&PlatformAppPathLauncher::Launch, this)); |
| 186 | } |
| 187 | |
mostynb | ecb4a22b | 2016-04-04 06:08:01 | [diff] [blame] | 188 | void OnFilesValid(std::unique_ptr<std::set<base::FilePath>> directory_paths) { |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 189 | mime_type_collector_.CollectForLocalPaths( |
| 190 | entry_paths_, |
| 191 | base::Bind( |
| 192 | &PlatformAppPathLauncher::OnAreDirectoriesAndMimeTypesCollected, |
| 193 | this, base::Passed(std::move(directory_paths)))); |
[email protected] | ffb8706 | 2013-08-29 10:02:25 | [diff] [blame] | 194 | } |
| 195 | |
[email protected] | fb6de88 | 2014-07-03 07:50:17 | [diff] [blame] | 196 | void OnFilesInvalid(const base::FilePath& /* error_path */) { |
[email protected] | ffb8706 | 2013-08-29 10:02:25 | [diff] [blame] | 197 | LaunchWithNoLaunchData(); |
| 198 | } |
| 199 | |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 200 | void LaunchWithNoLaunchData() { |
| 201 | // This method is required as an entry point on the UI thread. |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 202 | DCHECK_CURRENTLY_ON(BrowserThread::UI); |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 203 | |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 204 | const Extension* app = GetExtension(); |
| 205 | if (!app) |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 206 | return; |
| 207 | |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 208 | std::unique_ptr<app_runtime::LaunchData> launch_data = |
| 209 | base::MakeUnique<app_runtime::LaunchData>(); |
| 210 | launch_data->action_data = std::move(action_data_); |
| 211 | |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 212 | AppRuntimeEventRouter::DispatchOnLaunchedEvent( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 213 | context_, app, launch_source_, std::move(launch_data)); |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 214 | } |
| 215 | |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 216 | void OnAreDirectoriesCollected( |
| 217 | bool has_file_system_write_permission, |
mostynb | ecb4a22b | 2016-04-04 06:08:01 | [diff] [blame] | 218 | std::unique_ptr<std::set<base::FilePath>> directory_paths) { |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 219 | if (has_file_system_write_permission) { |
| 220 | std::set<base::FilePath>* const directory_paths_ptr = |
| 221 | directory_paths.get(); |
| 222 | PrepareFilesForWritableApp( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 223 | entry_paths_, context_, *directory_paths_ptr, |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 224 | base::Bind(&PlatformAppPathLauncher::OnFilesValid, this, |
| 225 | base::Passed(std::move(directory_paths))), |
| 226 | base::Bind(&PlatformAppPathLauncher::OnFilesInvalid, this)); |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | OnFilesValid(std::move(directory_paths)); |
| 231 | } |
| 232 | |
| 233 | void OnAreDirectoriesAndMimeTypesCollected( |
mostynb | ecb4a22b | 2016-04-04 06:08:01 | [diff] [blame] | 234 | std::unique_ptr<std::set<base::FilePath>> directory_paths, |
| 235 | std::unique_ptr<std::vector<std::string>> mime_types) { |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 236 | DCHECK(entry_paths_.size() == mime_types->size()); |
| 237 | // If fetching a mime type failed, then use a fallback one. |
| 238 | for (size_t i = 0; i < entry_paths_.size(); ++i) { |
| 239 | const std::string mime_type = |
| 240 | !(*mime_types)[i].empty() ? (*mime_types)[i] : kFallbackMimeType; |
| 241 | bool is_directory = |
| 242 | directory_paths->find(entry_paths_[i]) != directory_paths->end(); |
| 243 | entries_.push_back( |
| 244 | extensions::EntryInfo(entry_paths_[i], mime_type, is_directory)); |
| 245 | } |
[email protected] | fb6de88 | 2014-07-03 07:50:17 | [diff] [blame] | 246 | |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 247 | const Extension* app = GetExtension(); |
| 248 | if (!app) |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 249 | return; |
| 250 | |
[email protected] | 8427a062 | 2013-02-11 17:00:57 | [diff] [blame] | 251 | // Find file handler from the platform app for the file being opened. |
[email protected] | 24c81d69 | 2013-08-07 14:09:48 | [diff] [blame] | 252 | const extensions::FileHandlerInfo* handler = NULL; |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 253 | if (!handler_id_.empty()) { |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 254 | handler = FileHandlerForId(*app, handler_id_); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 255 | if (handler) { |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 256 | for (size_t i = 0; i < entry_paths_.size(); ++i) { |
| 257 | if (!FileHandlerCanHandleEntry(*handler, entries_[i])) { |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 258 | LOG(WARNING) |
| 259 | << "Extension does not provide a valid file handler for " |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 260 | << entry_paths_[i].value(); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 261 | handler = NULL; |
| 262 | break; |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | } else { |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 267 | const std::vector<const extensions::FileHandlerInfo*>& handlers = |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 268 | extensions::app_file_handler_util::FindFileHandlersForEntries( |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 269 | *app, entries_); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 270 | if (!handlers.empty()) |
| 271 | handler = handlers[0]; |
[email protected] | af8dc08e | 2012-11-22 01:58:42 | [diff] [blame] | 272 | } |
[email protected] | af8dc08e | 2012-11-22 01:58:42 | [diff] [blame] | 273 | |
[email protected] | 8427a062 | 2013-02-11 17:00:57 | [diff] [blame] | 274 | // If this app doesn't have a file handler that supports the file, launch |
| 275 | // with no launch data. |
| 276 | if (!handler) { |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 277 | LOG(WARNING) << "Extension does not provide a valid file handler."; |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 278 | LaunchWithNoLaunchData(); |
| 279 | return; |
| 280 | } |
| 281 | |
[email protected] | 56573d7 | 2013-05-09 06:36:37 | [diff] [blame] | 282 | if (handler_id_.empty()) |
| 283 | handler_id_ = handler->id; |
| 284 | |
[email protected] | 4e04f1e | 2012-06-20 03:20:31 | [diff] [blame] | 285 | // Access needs to be granted to the file for the process associated with |
| 286 | // the extension. To do this the ExtensionHost is needed. This might not be |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 287 | // available, or it might be in the process of being unloaded, in which case |
[email protected] | 4e04f1e | 2012-06-20 03:20:31 | [diff] [blame] | 288 | // the lazy background task queue is used to load the extension and then |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 289 | // call back to us. |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 290 | extensions::LazyBackgroundTaskQueue* const queue = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 291 | extensions::LazyBackgroundTaskQueue::Get(context_); |
| 292 | if (queue->ShouldEnqueueTask(context_, app)) { |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 293 | queue->AddPendingTask( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 294 | context_, extension_id, |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 295 | base::Bind(&PlatformAppPathLauncher::GrantAccessToFilesAndLaunch, |
| 296 | this)); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 297 | return; |
| 298 | } |
| 299 | |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 300 | extensions::ProcessManager* const process_manager = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 301 | extensions::ProcessManager::Get(context_); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 302 | ExtensionHost* const host = |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 303 | process_manager->GetBackgroundHostForExtension(extension_id); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 304 | DCHECK(host); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 305 | GrantAccessToFilesAndLaunch(host); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 306 | } |
| 307 | |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 308 | void GrantAccessToFilesAndLaunch(ExtensionHost* host) { |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 309 | const Extension* app = GetExtension(); |
| 310 | if (!app) |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 311 | return; |
| 312 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 313 | // If there was an error loading the app page, |host| will be NULL. |
| 314 | if (!host) { |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 315 | LOG(ERROR) << "Could not load app page for " << extension_id; |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 316 | return; |
| 317 | } |
| 318 | |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 319 | std::vector<GrantedFileEntry> granted_entries; |
| 320 | for (size_t i = 0; i < entry_paths_.size(); ++i) { |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 321 | granted_entries.push_back( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 322 | CreateFileEntry(context_, app, host->render_process_host()->GetID(), |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 323 | entries_[i].path, entries_[i].is_directory)); |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 324 | } |
| 325 | |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 326 | AppRuntimeEventRouter::DispatchOnLaunchedEventWithFileEntries( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 327 | context_, app, launch_source_, handler_id_, entries_, granted_entries, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 328 | std::move(action_data_)); |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | const Extension* GetExtension() const { |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 332 | return extensions::ExtensionRegistry::Get(context_)->GetExtensionById( |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 333 | extension_id, extensions::ExtensionRegistry::EVERYTHING); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 334 | } |
| 335 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 336 | // The browser context the app should be run in. |
| 337 | content::BrowserContext* context_; |
benwells | 8af3948 | 2014-11-20 08:32:31 | [diff] [blame] | 338 | // The id of the extension providing the app. A pointer to the extension is |
| 339 | // not kept as the extension may be unloaded and deleted during the course of |
| 340 | // the launch. |
| 341 | const std::string extension_id; |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 342 | extensions::AppLaunchSource launch_source_ = extensions::SOURCE_FILE_HANDLER; |
| 343 | std::unique_ptr<app_runtime::ActionData> action_data_; |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 344 | // A list of files and directories to be passed through to the app. |
| 345 | std::vector<base::FilePath> entry_paths_; |
| 346 | // A corresponding list with EntryInfo for every base::FilePath in |
| 347 | // entry_paths_. |
| 348 | std::vector<extensions::EntryInfo> entries_; |
[email protected] | af8dc08e | 2012-11-22 01:58:42 | [diff] [blame] | 349 | // The ID of the file handler used to launch the app. |
| 350 | std::string handler_id_; |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 351 | extensions::app_file_handler_util::MimeTypeCollector mime_type_collector_; |
| 352 | extensions::app_file_handler_util::IsDirectoryCollector |
| 353 | is_directory_collector_; |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 354 | |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 355 | DISALLOW_COPY_AND_ASSIGN(PlatformAppPathLauncher); |
[email protected] | 4e04f1e | 2012-06-20 03:20:31 | [diff] [blame] | 356 | }; |
| 357 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 358 | } // namespace |
| 359 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 360 | void LaunchPlatformAppWithCommandLine(content::BrowserContext* context, |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 361 | const extensions::Extension* app, |
pgal.u-szeged | 214274b | 2014-10-28 11:59:48 | [diff] [blame] | 362 | const base::CommandLine& command_line, |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 363 | const base::FilePath& current_directory, |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 364 | extensions::AppLaunchSource source, |
| 365 | PlayStoreStatus play_store_status) { |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 366 | LaunchPlatformAppWithCommandLineAndLaunchId(context, app, "", command_line, |
andra.paraschiv | 4e4fb8bb | 2016-12-15 11:13:54 | [diff] [blame] | 367 | current_directory, source, |
| 368 | play_store_status); |
| 369 | } |
| 370 | |
| 371 | void LaunchPlatformAppWithCommandLineAndLaunchId( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 372 | content::BrowserContext* context, |
andra.paraschiv | 4e4fb8bb | 2016-12-15 11:13:54 | [diff] [blame] | 373 | const extensions::Extension* app, |
| 374 | const std::string& launch_id, |
| 375 | const base::CommandLine& command_line, |
| 376 | const base::FilePath& current_directory, |
| 377 | extensions::AppLaunchSource source, |
| 378 | PlayStoreStatus play_store_status) { |
[email protected] | 14a18bf | 2013-09-26 08:42:30 | [diff] [blame] | 379 | // An app with "kiosk_only" should not be installed and launched |
| 380 | // outside of ChromeOS kiosk mode in the first place. This is a defensive |
| 381 | // check in case this scenario does occur. |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 382 | if (extensions::KioskModeInfo::IsKioskOnly(app)) { |
[email protected] | 14a18bf | 2013-09-26 08:42:30 | [diff] [blame] | 383 | bool in_kiosk_mode = false; |
| 384 | #if defined(OS_CHROMEOS) |
[email protected] | 4d39078 | 2014-08-15 09:22:58 | [diff] [blame] | 385 | user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
[email protected] | 14a18bf | 2013-09-26 08:42:30 | [diff] [blame] | 386 | in_kiosk_mode = user_manager && user_manager->IsLoggedInAsKioskApp(); |
| 387 | #endif |
| 388 | if (!in_kiosk_mode) { |
| 389 | LOG(ERROR) << "App with 'kiosk_only' attribute must be run in " |
andra.paraschiv | 4e4fb8bb | 2016-12-15 11:13:54 | [diff] [blame] | 390 | << " ChromeOS kiosk mode."; |
[email protected] | 14a18bf | 2013-09-26 08:42:30 | [diff] [blame] | 391 | NOTREACHED(); |
[email protected] | 8a01117 | 2013-08-09 04:29:23 | [diff] [blame] | 392 | return; |
| 393 | } |
[email protected] | 14a18bf | 2013-09-26 08:42:30 | [diff] [blame] | 394 | } |
[email protected] | 8a01117 | 2013-08-09 04:29:23 | [diff] [blame] | 395 | |
[email protected] | 4c35abc | 2014-05-14 02:13:58 | [diff] [blame] | 396 | #if defined(OS_WIN) |
| 397 | base::CommandLine::StringType about_blank_url( |
thestig | e5c64d9 | 2014-11-07 01:19:24 | [diff] [blame] | 398 | base::ASCIIToUTF16(url::kAboutBlankURL)); |
[email protected] | 4c35abc | 2014-05-14 02:13:58 | [diff] [blame] | 399 | #else |
[email protected] | 8e09c7af | 2014-06-10 11:46:17 | [diff] [blame] | 400 | base::CommandLine::StringType about_blank_url(url::kAboutBlankURL); |
[email protected] | 4c35abc | 2014-05-14 02:13:58 | [diff] [blame] | 401 | #endif |
pgal.u-szeged | 214274b | 2014-10-28 11:59:48 | [diff] [blame] | 402 | base::CommandLine::StringVector args = command_line.GetArgs(); |
[email protected] | 4c35abc | 2014-05-14 02:13:58 | [diff] [blame] | 403 | // Browser tests will add about:blank to the command line. This should |
| 404 | // never be interpreted as a file to open, as doing so with an app that |
| 405 | // has write access will result in a file 'about' being created, which |
| 406 | // causes problems on the bots. |
| 407 | if (args.empty() || (command_line.HasSwitch(switches::kTestType) && |
| 408 | args[0] == about_blank_url)) { |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 409 | std::unique_ptr<app_runtime::LaunchData> launch_data = |
| 410 | base::MakeUnique<app_runtime::LaunchData>(); |
| 411 | if (play_store_status != PlayStoreStatus::PLAY_STORE_STATUS_UNKNOWN) |
| 412 | launch_data->play_store_status = play_store_status; |
andra.paraschiv | 4e4fb8bb | 2016-12-15 11:13:54 | [diff] [blame] | 413 | if (!launch_id.empty()) |
| 414 | launch_data->id.reset(new std::string(launch_id)); |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 415 | AppRuntimeEventRouter::DispatchOnLaunchedEvent(context, app, source, |
rkc | 79bf63c | 2016-08-25 21:07:23 | [diff] [blame] | 416 | std::move(launch_data)); |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 417 | return; |
| 418 | } |
| 419 | |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 420 | base::FilePath file_path(command_line.GetArgs()[0]); |
| 421 | scoped_refptr<PlatformAppPathLauncher> launcher = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 422 | new PlatformAppPathLauncher(context, app, file_path); |
[email protected] | 3567d14 | 2014-05-12 11:49:43 | [diff] [blame] | 423 | launcher->LaunchWithRelativePath(current_directory); |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 424 | } |
| 425 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 426 | void LaunchPlatformAppWithPath(content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 427 | const Extension* app, |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 428 | const base::FilePath& file_path) { |
[email protected] | a228c84 | 2012-09-04 10:07:05 | [diff] [blame] | 429 | scoped_refptr<PlatformAppPathLauncher> launcher = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 430 | new PlatformAppPathLauncher(context, app, file_path); |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 431 | launcher->Launch(); |
| 432 | } |
| 433 | |
| 434 | void LaunchPlatformAppWithAction( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 435 | content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 436 | const extensions::Extension* app, |
| 437 | std::unique_ptr<app_runtime::ActionData> action_data, |
| 438 | const base::FilePath& file_path) { |
tbarzic | 8bf50fca | 2017-06-22 03:02:18 | [diff] [blame] | 439 | CHECK(!action_data || !action_data->is_lock_screen_action || |
| 440 | !*action_data->is_lock_screen_action || |
| 441 | app->permissions_data()->HasAPIPermission( |
| 442 | extensions::APIPermission::kLockScreen)) |
| 443 | << "Launching lock screen action handler requires lockScreen permission."; |
| 444 | |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 445 | scoped_refptr<PlatformAppPathLauncher> launcher = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 446 | new PlatformAppPathLauncher(context, app, file_path); |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 447 | launcher->set_action_data(std::move(action_data)); |
| 448 | launcher->set_launch_source(extensions::AppLaunchSource::SOURCE_UNTRACKED); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 449 | launcher->Launch(); |
| 450 | } |
| 451 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 452 | void LaunchPlatformApp(content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 453 | const Extension* app, |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 454 | extensions::AppLaunchSource source) { |
| 455 | LaunchPlatformAppWithCommandLine( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 456 | context, app, base::CommandLine(base::CommandLine::NO_PROGRAM), |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 457 | base::FilePath(), source); |
[email protected] | 2a69b94 | 2013-05-31 09:37:53 | [diff] [blame] | 458 | } |
| 459 | |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 460 | void LaunchPlatformAppWithFileHandler( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 461 | content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 462 | const Extension* app, |
[email protected] | 3113a23 | 2014-06-04 09:40:29 | [diff] [blame] | 463 | const std::string& handler_id, |
cmihail | 20232c2 | 2016-02-25 02:15:21 | [diff] [blame] | 464 | const std::vector<base::FilePath>& entry_paths) { |
[email protected] | af8dc08e | 2012-11-22 01:58:42 | [diff] [blame] | 465 | scoped_refptr<PlatformAppPathLauncher> launcher = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 466 | new PlatformAppPathLauncher(context, app, entry_paths); |
[email protected] | af8dc08e | 2012-11-22 01:58:42 | [diff] [blame] | 467 | launcher->LaunchWithHandler(handler_id); |
| 468 | } |
| 469 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 470 | void RestartPlatformApp(content::BrowserContext* context, |
| 471 | const Extension* app) { |
| 472 | EventRouter* event_router = EventRouter::Get(context); |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 473 | bool listening_to_restart = event_router->ExtensionHasEventListener( |
| 474 | app->id(), app_runtime::OnRestarted::kEventName); |
[email protected] | 771c8d27 | 2013-05-17 09:47:40 | [diff] [blame] | 475 | |
| 476 | if (listening_to_restart) { |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 477 | AppRuntimeEventRouter::DispatchOnRestartedEvent(context, app); |
[email protected] | 771c8d27 | 2013-05-17 09:47:40 | [diff] [blame] | 478 | return; |
| 479 | } |
| 480 | |
[email protected] | 2d9f2a79 | 2014-01-24 12:44:09 | [diff] [blame] | 481 | extensions::ExtensionPrefs* extension_prefs = |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 482 | extensions::ExtensionPrefs::Get(context); |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 483 | bool had_windows = extension_prefs->IsActive(app->id()); |
| 484 | extension_prefs->SetIsActive(app->id(), false); |
| 485 | bool listening_to_launch = event_router->ExtensionHasEventListener( |
| 486 | app->id(), app_runtime::OnLaunched::kEventName); |
[email protected] | 771c8d27 | 2013-05-17 09:47:40 | [diff] [blame] | 487 | |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 488 | if (listening_to_launch && had_windows) { |
| 489 | AppRuntimeEventRouter::DispatchOnLaunchedEvent( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 490 | context, app, extensions::SOURCE_RESTART, nullptr); |
cylee | 988a9bb5 | 2014-11-04 16:39:16 | [diff] [blame] | 491 | } |
[email protected] | fc2a40f | 2013-03-13 13:14:57 | [diff] [blame] | 492 | } |
| 493 | |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 494 | void LaunchPlatformAppWithUrl(content::BrowserContext* context, |
jdufault | 9d3e955f | 2016-08-16 22:19:11 | [diff] [blame] | 495 | const Extension* app, |
[email protected] | 43197ea2 | 2013-09-10 15:31:56 | [diff] [blame] | 496 | const std::string& handler_id, |
| 497 | const GURL& url, |
| 498 | const GURL& referrer_url) { |
[email protected] | ce5f1b3 | 2014-06-22 01:46:45 | [diff] [blame] | 499 | AppRuntimeEventRouter::DispatchOnLaunchedEventWithUrl( |
michaelpg | 4d80e56 | 2017-04-04 01:48:14 | [diff] [blame] | 500 | context, app, handler_id, url, referrer_url); |
[email protected] | 43197ea2 | 2013-09-10 15:31:56 | [diff] [blame] | 501 | } |
| 502 | |
[email protected] | 24c81d69 | 2013-08-07 14:09:48 | [diff] [blame] | 503 | } // namespace apps |