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

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

Issue 12225076: Delete most web intents code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 e035ff19d0bea97d1f33fa7fc25d4add78ad1328..e23964185b098be1c800ebbaf6137a4bcfe862fa 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -9,39 +9,16 @@
#include "base/stl_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/content_settings/cookie_settings.h"
-#include "chrome/browser/intents/web_intents_util.h"
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/web_intents_handler.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/common/constants.h"
-#include "webkit/glue/web_intent_service_data.h"
using content::BrowserThread;
using extensions::APIPermission;
-namespace {
-
-// Does the specified extension support the passed Web Intent, |action|?
-bool ExtensionSupportsIntentAction(
- const extensions::Extension* extension,
- const std::string& action) {
-#if defined(ENABLE_WEB_INTENTS)
- for (std::vector<webkit_glue::WebIntentServiceData>::const_iterator i =
- extensions::WebIntentsInfo::GetIntentsServices(extension).begin();
- i != extensions::WebIntentsInfo::GetIntentsServices(extension).end();
- ++i) {
- if (UTF16ToUTF8(i->action) == action)
- return true;
- }
-#endif
- return false;
-}
-
-} // namespace
-
ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy(
CookieSettings* cookie_settings)
: cookie_settings_(cookie_settings) {}
@@ -88,8 +65,7 @@ bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() {
bool ExtensionSpecialStoragePolicy::IsFileHandler(
const std::string& extension_id) {
base::AutoLock locker(lock_);
- return web_intent_extensions_.ContainsExtension(extension_id) ||
- file_handler_extensions_.ContainsExtension(extension_id);
+ return file_handler_extensions_.ContainsExtension(extension_id);
}
bool ExtensionSpecialStoragePolicy::NeedsProtection(
@@ -106,14 +82,11 @@ const ExtensionSet* ExtensionSpecialStoragePolicy::ExtensionsProtectingOrigin(
void ExtensionSpecialStoragePolicy::GrantRightsForExtension(
const extensions::Extension* extension) {
DCHECK(extension);
- const bool supports_intent_view = ExtensionSupportsIntentAction(
- extension, web_intents::kActionView);
if (!NeedsProtection(extension) &&
!extension->HasAPIPermission(
APIPermission::kUnlimitedStorage) &&
!extension->HasAPIPermission(
- APIPermission::kFileBrowserHandler) &&
- !supports_intent_view) {
+ APIPermission::kFileBrowserHandler)) {
return;
}
{
@@ -128,8 +101,6 @@ void ExtensionSpecialStoragePolicy::GrantRightsForExtension(
if (extension->HasAPIPermission(
APIPermission::kFileBrowserHandler))
file_handler_extensions_.Add(extension);
- if (supports_intent_view)
- web_intent_extensions_.Add(extension);
}
NotifyChanged();
}
@@ -137,14 +108,11 @@ void ExtensionSpecialStoragePolicy::GrantRightsForExtension(
void ExtensionSpecialStoragePolicy::RevokeRightsForExtension(
const extensions::Extension* extension) {
DCHECK(extension);
- const bool supports_intent_view = ExtensionSupportsIntentAction(
- extension, web_intents::kActionView);
if (!NeedsProtection(extension) &&
!extension->HasAPIPermission(
APIPermission::kUnlimitedStorage) &&
!extension->HasAPIPermission(
- APIPermission::kFileBrowserHandler) &&
- !supports_intent_view) {
+ APIPermission::kFileBrowserHandler)) {
return;
}
{
@@ -157,8 +125,6 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForExtension(
unlimited_extensions_.Remove(extension);
if (extension->HasAPIPermission(APIPermission::kFileBrowserHandler))
file_handler_extensions_.Remove(extension);
- if (supports_intent_view)
- web_intent_extensions_.Remove(extension);
}
NotifyChanged();
}
@@ -170,7 +136,6 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForAllExtensions() {
installed_apps_.Clear();
unlimited_extensions_.Clear();
file_handler_extensions_.Clear();
- web_intent_extensions_.Clear();
}
NotifyChanged();
}

Powered by Google App Engine
This is Rietveld 408576698