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/extensions/platform_app_launcher.h" | 5 #include "chrome/browser/extensions/platform_app_launcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // regranted, as this would overwrite any other permissions which the | 233 // regranted, as this would overwrite any other permissions which the |
234 // renderer may already have. | 234 // renderer may already have. |
235 if (!policy->CanReadFile(renderer_id, file_path_)) | 235 if (!policy->CanReadFile(renderer_id, file_path_)) |
236 policy->GrantReadFile(renderer_id, file_path_); | 236 policy->GrantReadFile(renderer_id, file_path_); |
237 | 237 |
238 std::string registered_name; | 238 std::string registered_name; |
239 fileapi::IsolatedContext* isolated_context = | 239 fileapi::IsolatedContext* isolated_context = |
240 fileapi::IsolatedContext::GetInstance(); | 240 fileapi::IsolatedContext::GetInstance(); |
241 DCHECK(isolated_context); | 241 DCHECK(isolated_context); |
242 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( | 242 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( |
243 fileapi::kFileSystemTypeNativeLocal, file_path_, ®istered_name); | 243 fileapi::kFileSystemTypeNativeLocal, file_path_, |
| 244 ®istered_name); |
244 // Granting read file system permission as well to allow file-system | 245 // Granting read file system permission as well to allow file-system |
245 // read operations. | 246 // read operations. |
246 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 247 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
247 | 248 |
248 extensions::AppEventRouter::DispatchOnLaunchedEventWithFileEntry( | 249 extensions::AppEventRouter::DispatchOnLaunchedEventWithFileEntry( |
249 profile_, extension_, ASCIIToUTF16(web_intents::kActionView), | 250 profile_, extension_, ASCIIToUTF16(web_intents::kActionView), |
250 handler_id_, mime_type, filesystem_id, registered_name); | 251 handler_id_, mime_type, filesystem_id, registered_name); |
251 } | 252 } |
252 | 253 |
253 // The profile the app should be run in. | 254 // The profile the app should be run in. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 const Extension* extension, | 411 const Extension* extension, |
411 content::WebIntentsDispatcher* intents_dispatcher, | 412 content::WebIntentsDispatcher* intents_dispatcher, |
412 content::WebContents* source) { | 413 content::WebContents* source) { |
413 scoped_refptr<PlatformAppWebIntentLauncher> launcher = | 414 scoped_refptr<PlatformAppWebIntentLauncher> launcher = |
414 new PlatformAppWebIntentLauncher( | 415 new PlatformAppWebIntentLauncher( |
415 profile, extension, intents_dispatcher, source); | 416 profile, extension, intents_dispatcher, source); |
416 launcher->Launch(); | 417 launcher->Launch(); |
417 } | 418 } |
418 | 419 |
419 } // namespace extensions | 420 } // namespace extensions |
OLD | NEW |