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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // regranted, as this would overwrite any other permissions which the | 196 // regranted, as this would overwrite any other permissions which the |
197 // renderer may already have. | 197 // renderer may already have. |
198 if (!policy->CanReadFile(renderer_id, file_path)) | 198 if (!policy->CanReadFile(renderer_id, file_path)) |
199 policy->GrantReadFile(renderer_id, file_path); | 199 policy->GrantReadFile(renderer_id, file_path); |
200 | 200 |
201 std::string registered_name; | 201 std::string registered_name; |
202 fileapi::IsolatedContext* isolated_context = | 202 fileapi::IsolatedContext* isolated_context = |
203 fileapi::IsolatedContext::GetInstance(); | 203 fileapi::IsolatedContext::GetInstance(); |
204 DCHECK(isolated_context); | 204 DCHECK(isolated_context); |
205 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( | 205 std::string filesystem_id = isolated_context->RegisterFileSystemForPath( |
206 fileapi::kFileSystemTypeIsolated, file_path, ®istered_name); | 206 fileapi::kFileSystemTypeNativeLocal, file_path, ®istered_name); |
207 // Granting read file system permission as well to allow file-system | 207 // Granting read file system permission as well to allow file-system |
208 // read operations. | 208 // read operations. |
209 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 209 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
210 | 210 |
211 extensions::AppEventRouter::DispatchOnLaunchedEventWithFileEntry( | 211 extensions::AppEventRouter::DispatchOnLaunchedEventWithFileEntry( |
212 profile_, extension_, ASCIIToUTF16(kViewIntent), filesystem_id, | 212 profile_, extension_, ASCIIToUTF16(kViewIntent), filesystem_id, |
213 registered_name); | 213 registered_name); |
214 } | 214 } |
215 | 215 |
216 // The profile the app should be run in. | 216 // The profile the app should be run in. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 new PlatformAppBlobIntentLauncher(profile, extension, web_intent_data); | 327 new PlatformAppBlobIntentLauncher(profile, extension, web_intent_data); |
328 launcher->Launch(); | 328 launcher->Launch(); |
329 return; | 329 return; |
330 } | 330 } |
331 | 331 |
332 extensions::AppEventRouter::DispatchOnLaunchedEventWithWebIntent( | 332 extensions::AppEventRouter::DispatchOnLaunchedEventWithWebIntent( |
333 profile, extension, web_intent_data); | 333 profile, extension, web_intent_data); |
334 } | 334 } |
335 | 335 |
336 } // namespace extensions | 336 } // namespace extensions |
OLD | NEW |