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

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

Issue 10834383: Chrome OS "open with" picker allowing Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed mime matching code, asserts that the mime-pattern "*" matches a blank mime-type (i.e. "*" mat… Created 8 years, 4 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/extension_special_storage_policy.cc
diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc
index 940a53ce0c986776b59da4b762007a83c2ef0b23..7e69ea5981890f8f7db044f213120ac8d63fb5d2 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -13,6 +13,7 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
+#include "webkit/glue/web_intent_service_data.h"
using content::BrowserThread;
using extensions::APIPermission;
@@ -59,7 +60,8 @@ bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() {
bool ExtensionSpecialStoragePolicy::IsFileHandler(
const std::string& extension_id) {
base::AutoLock locker(lock_);
- return file_handler_extensions_.ContainsExtension(extension_id);
+ return web_intent_extensions_.ContainsExtension(extension_id) ||
+ file_handler_extensions_.ContainsExtension(extension_id);
}
bool ExtensionSpecialStoragePolicy::NeedsProtection(
@@ -80,7 +82,8 @@ void ExtensionSpecialStoragePolicy::GrantRightsForExtension(
!extension->HasAPIPermission(
APIPermission::kUnlimitedStorage) &&
!extension->HasAPIPermission(
- APIPermission::kFileBrowserHandler)) {
+ APIPermission::kFileBrowserHandler) &&
+ extension->intents_services().empty()) {
benwells 2012/08/27 08:02:59 We need to do this only if the service is for the
thorogood 2012/08/29 06:34:46 Done.
return;
}
{
@@ -90,9 +93,10 @@ void ExtensionSpecialStoragePolicy::GrantRightsForExtension(
if (extension->HasAPIPermission(APIPermission::kUnlimitedStorage))
unlimited_extensions_.Add(extension);
if (extension->HasAPIPermission(
- APIPermission::kFileBrowserHandler)) {
+ APIPermission::kFileBrowserHandler))
file_handler_extensions_.Add(extension);
- }
+ if (!extension->intents_services().empty())
+ web_intent_extensions_.Add(extension);
}
NotifyChanged();
}
@@ -104,7 +108,8 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForExtension(
!extension->HasAPIPermission(
APIPermission::kUnlimitedStorage) &&
!extension->HasAPIPermission(
- APIPermission::kFileBrowserHandler)) {
+ APIPermission::kFileBrowserHandler) &&
+ extension->intents_services().empty()) {
return;
}
{
@@ -115,6 +120,8 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForExtension(
unlimited_extensions_.Remove(extension);
if (extension->HasAPIPermission(APIPermission::kFileBrowserHandler))
file_handler_extensions_.Remove(extension);
+ if (!extension->intents_services().empty())
+ web_intent_extensions_.Add(extension);
}
NotifyChanged();
}
@@ -125,6 +132,7 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForAllExtensions() {
protected_apps_.Clear();
unlimited_extensions_.Clear();
file_handler_extensions_.Clear();
+ web_intent_extensions_.Clear();
}
NotifyChanged();
}

Powered by Google App Engine
This is Rietveld 408576698