diff options
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_file_util.cc | 23 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_file_util_unittest.cc | 34 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 44 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.h | 7 |
4 files changed, 0 insertions, 108 deletions
diff --git a/chrome/browser/extensions/extension_file_util.cc b/chrome/browser/extensions/extension_file_util.cc index a9db4b3..346bfab 100644 --- a/chrome/browser/extensions/extension_file_util.cc +++ b/chrome/browser/extensions/extension_file_util.cc @@ -11,8 +11,6 @@ #include "base/string_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_prefs.h" -#include "chrome/browser/privacy_blacklist/blacklist.h" -#include "chrome/browser/privacy_blacklist/blacklist_io.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_l10n_util.h" #include "chrome/common/extensions/extension_constants.h" @@ -227,27 +225,6 @@ bool ValidateExtension(Extension* extension, std::string* error) { } } - // Validate claimed privacy blacklists. - for (size_t i = 0; i < extension->privacy_blacklists().size(); ++i) { - const Extension::PrivacyBlacklistInfo& blacklist_info = - extension->privacy_blacklists()[i]; - std::string path_utf8(WideToUTF8(blacklist_info.path.ToWStringHack())); - if (!file_util::PathExists(blacklist_info.path)) { - *error = StringPrintf("Could not load '%s' for privacy blacklist: " - "file does not exist.", - path_utf8.c_str()); - return false; - } - Blacklist blacklist; - std::string parsing_error; - if (!BlacklistIO::ReadText(&blacklist, blacklist_info.path, - &parsing_error)) { - *error = StringPrintf("Could not load '%s' for privacy blacklist: %s", - path_utf8.c_str(), parsing_error.c_str()); - return false; - } - } - // Validate icon location for page actions. ExtensionAction* page_action = extension->page_action(); if (page_action) { diff --git a/chrome/browser/extensions/extension_file_util_unittest.cc b/chrome/browser/extensions/extension_file_util_unittest.cc index 6266c22..31ed023 100644 --- a/chrome/browser/extensions/extension_file_util_unittest.cc +++ b/chrome/browser/extensions/extension_file_util_unittest.cc @@ -220,40 +220,6 @@ TEST(ExtensionFileUtil, LoadExtensionGivesHelpfullErrorOnBadManifest) { "Line: 2, column: 16, Syntax error.", error.c_str()); } -TEST(ExtensionFileUtil, MissingPrivacyBlacklist) { - FilePath install_dir; - ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &install_dir)); - install_dir = install_dir.AppendASCII("extensions") - .AppendASCII("privacy_blacklists") - .AppendASCII("missing_blacklist"); - - std::string error; - scoped_ptr<Extension> extension( - extension_file_util::LoadExtension(install_dir, false, &error)); - ASSERT_TRUE(extension == NULL); - ASSERT_FALSE(error.empty()); - EXPECT_TRUE(MatchPatternASCII(error, - "Could not load '*privacy_blacklist.pbl' for privacy blacklist: " - "file does not exist.")) << error; -} - -TEST(ExtensionFileUtil, InvalidPrivacyBlacklist) { - FilePath install_dir; - ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &install_dir)); - install_dir = install_dir.AppendASCII("extensions") - .AppendASCII("privacy_blacklists") - .AppendASCII("invalid_blacklist"); - - std::string error; - scoped_ptr<Extension> extension( - extension_file_util::LoadExtension(install_dir, false, &error)); - ASSERT_TRUE(extension == NULL); - ASSERT_FALSE(error.empty()); - EXPECT_TRUE(MatchPatternASCII(error, - "Could not load '*privacy_blacklist.pbl' for privacy blacklist: " - "Incorrect header.")) << error; -} - #define URL_PREFIX "chrome-extension://extension-id/" TEST(ExtensionFileUtil, ExtensionURLToRelativeFilePath) { diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index dc0c0ae..a8eccf0 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -815,50 +815,6 @@ void ExtensionsService::ReportExtensionLoadError( ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy); } -bool ExtensionsService::AreBlacklistPathsReady() const { - return ready_; -} - -std::vector<FilePath> ExtensionsService::GetPersistentBlacklistPaths() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - - std::vector<FilePath> result; - for (ExtensionList::const_iterator extension_iter = extensions()->begin(); - extension_iter != extensions()->end(); ++extension_iter) { - if ((*extension_iter)->location() == Extension::LOAD) - continue; - - std::vector<Extension::PrivacyBlacklistInfo> blacklists( - (*extension_iter)->privacy_blacklists()); - std::vector<Extension::PrivacyBlacklistInfo>::const_iterator blacklist_iter; - for (blacklist_iter = blacklists.begin(); - blacklist_iter != blacklists.end(); ++blacklist_iter) { - result.push_back(blacklist_iter->path); - } - } - return result; -} - -std::vector<FilePath> ExtensionsService::GetTransientBlacklistPaths() { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - - std::vector<FilePath> result; - for (ExtensionList::const_iterator extension_iter = extensions()->begin(); - extension_iter != extensions()->end(); ++extension_iter) { - if ((*extension_iter)->location() != Extension::LOAD) - continue; - - std::vector<Extension::PrivacyBlacklistInfo> blacklists( - (*extension_iter)->privacy_blacklists()); - std::vector<Extension::PrivacyBlacklistInfo>::const_iterator blacklist_iter; - for (blacklist_iter = blacklists.begin(); - blacklist_iter != blacklists.end(); ++blacklist_iter) { - result.push_back(blacklist_iter->path); - } - } - return result; -} - void ExtensionsService::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h index 12bb85e..4b18c90 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -25,7 +25,6 @@ #include "chrome/browser/extensions/extensions_quota_service.h" #include "chrome/browser/extensions/external_extension_provider.h" #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" -#include "chrome/browser/privacy_blacklist/blacklist_manager.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/extensions/extension.h" @@ -58,7 +57,6 @@ class ExtensionUpdateService { class ExtensionsService : public base::RefCountedThreadSafe<ExtensionsService, ChromeThread::DeleteOnUIThread>, - public BlacklistPathProvider, public ExtensionUpdateService, public NotificationObserver { public: @@ -241,11 +239,6 @@ class ExtensionsService NotificationType type, bool be_noisy); - // BlacklistPathProvider: - virtual bool AreBlacklistPathsReady() const; - virtual std::vector<FilePath> GetPersistentBlacklistPaths(); - virtual std::vector<FilePath> GetTransientBlacklistPaths(); - // NotificationObserver virtual void Observe(NotificationType type, const NotificationSource& source, |