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

Unified Diff: chrome/browser/extensions/platform_app_launcher.cc

Issue 14912009: Support getEntryId for entries passed to apps as launch data. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/platform_app_launcher.cc
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index 34ee359e87b490c4273ec62938178ab99b15cd3b..bffd8c826850d1dd200ed3396857ba781c13acf5 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -25,13 +25,11 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
#include "webkit/fileapi/file_system_types.h"
-#include "webkit/fileapi/isolated_context.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/drive/drive_system_service.h"
@@ -257,31 +255,14 @@ class PlatformAppPathLauncher
return;
}
- content::ChildProcessSecurityPolicy* policy =
- content::ChildProcessSecurityPolicy::GetInstance();
- int renderer_id = host->render_process_host()->GetID();
-
- // Granting read file permission to allow reading file content.
- // If the renderer already has permission to read these paths, it is not
- // regranted, as this would overwrite any other permissions which the
- // renderer may already have.
- if (!policy->CanReadFile(renderer_id, file_path_))
- policy->GrantReadFile(renderer_id, file_path_);
-
- std::string registered_name;
- fileapi::IsolatedContext* isolated_context =
- fileapi::IsolatedContext::GetInstance();
- DCHECK(isolated_context);
- std::string filesystem_id = isolated_context->RegisterFileSystemForPath(
- fileapi::kFileSystemTypeNativeForPlatformApp, file_path_,
- &registered_name);
- // Granting read file system permission as well to allow file-system
- // read operations.
- policy->GrantReadFileSystem(renderer_id, filesystem_id);
-
+ GrantedFileEntry file_entry = CreateFileEntry(
+ profile_,
+ extension_->id(),
+ host->render_process_host()->GetID(),
+ file_path_,
+ false);
AppEventRouter::DispatchOnLaunchedEventWithFileEntry(
- profile_, extension_, handler_id_, mime_type, filesystem_id,
- registered_name);
+ profile_, extension_, handler_id_, mime_type, file_entry);
}
// The profile the app should be run in.

Powered by Google App Engine
This is Rietveld 408576698