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

Side by Side Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 11648027: Extract external file systems handling from isolated context. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: few nits Created 7 years, 11 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/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
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_, &registered_name); 243 fileapi::kFileSystemTypeNativeLocal, file_path_,
244 &registered_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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698