From a1257b12bd288161e1eadeff9f2378de9b6e029a Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Fri, 12 Jun 2009 02:51:34 +0000 Subject: Factor out the code that deals with installing external extensions through Registry and Preferences into separate classes. While I was at it, I removed the EXTERNAL_INSTALL file, since we now keep track of this in the Preferences. This also takes care of the virtualization problem in the unit tests for vista (see bug). BUG=13063 TEST=None, covered by automated tests. Review URL: http://codereview.chromium.org/122004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18247 0039d316-1c4b-4281-b951-d872f2087c98 --- .../extensions/external_pref_extension_provider.h | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 chrome/browser/extensions/external_pref_extension_provider.h (limited to 'chrome/browser/extensions/external_pref_extension_provider.h') diff --git a/chrome/browser/extensions/external_pref_extension_provider.h b/chrome/browser/extensions/external_pref_extension_provider.h new file mode 100644 index 0000000..a52be411 --- /dev/null +++ b/chrome/browser/extensions/external_pref_extension_provider.h @@ -0,0 +1,33 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ +#define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ + +#include +#include + +#include "chrome/browser/extensions/external_extension_provider.h" + +class DictionaryValue; +class Version; + +// A specialization of the ExternalExtensionProvider that uses preferences to +// look up which external extensions are registered. +class ExternalPrefExtensionProvider : public ExternalExtensionProvider { + public: + explicit ExternalPrefExtensionProvider(DictionaryValue* prefs); + virtual ~ExternalPrefExtensionProvider(); + + // ExternalExtensionProvider implementation: + virtual void VisitRegisteredExtension( + Visitor* visitor, const std::set& ids_to_ignore) const; + + virtual Version* RegisteredVersion(std::string id, + Extension::Location* location) const; + protected: + scoped_ptr prefs_; +}; + +#endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ -- cgit v1.1