summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_service.h
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 21:19:54 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 21:19:54 +0000
commite2eb43115440dc442b92c5842274290caedb146f (patch)
tree32fd0e6ceb12b584bfb2e927c4294d9a0a9b96e4 /chrome/browser/extensions/extensions_service.h
parent87a22e7b22583637338dbe55398ae6711430437f (diff)
downloadchromium_src-e2eb43115440dc442b92c5842274290caedb146f.zip
chromium_src-e2eb43115440dc442b92c5842274290caedb146f.tar.gz
chromium_src-e2eb43115440dc442b92c5842274290caedb146f.tar.bz2
Allow themes to be installed without any commandline flag, still require flag for Extensions. Expand themes unittests.
BUG=12205,12231 TEST=Without any flags, try installing an extension and a theme. The extension should fail and the theme should succeed. Attempts to install a theme with extension components in the manifest should similarly result in failure. Review URL: http://codereview.chromium.org/115798 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service.h')
-rw-r--r--chrome/browser/extensions/extensions_service.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index 105533a..70373ff 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -9,11 +9,13 @@
#include <string>
#include <vector>
+#include "base/command_line.h"
#include "base/file_path.h"
#include "base/message_loop.h"
#include "base/ref_counted.h"
#include "base/task.h"
#include "base/values.h"
+#include "chrome/common/chrome_switches.h"
class Browser;
class Extension;
@@ -64,6 +66,16 @@ class ExtensionsService
// The name of the file that the current active version number is stored in.
static const char* kCurrentVersionFileName;
+ void set_extensions_enabled(bool enabled) { extensions_enabled_ = enabled; }
+ void set_show_extensions_disabled_notification(bool enabled) {
+ show_extensions_disabled_notification_ = enabled;
+ }
+
+ bool extensions_enabled() { return extensions_enabled_; }
+ bool show_extensions_disabled_notification() {
+ return show_extensions_disabled_notification_;
+ }
+
private:
// For OnExtensionLoaded, OnExtensionInstalled, and
// OnExtensionVersionReinstalled.
@@ -74,7 +86,7 @@ class ExtensionsService
// Called by the backend when an extensoin hsa been installed.
void OnExtensionInstalled(Extension* extension, bool is_update);
-
+
// Called by the backend when an extension has been reinstalled.
void OnExtensionVersionReinstalled(const std::string& id);
@@ -94,6 +106,13 @@ class ExtensionsService
// The full path to the directory where extensions are installed.
FilePath install_directory_;
+ // Whether or not extensions are enabled.
+ bool extensions_enabled_;
+
+ // Whether to notify users when they attempt to install an extension without
+ // the flag being enabled.
+ bool show_extensions_disabled_notification_;
+
// The backend that will do IO on behalf of this instance.
scoped_refptr<ExtensionsServiceBackend> backend_;
@@ -196,6 +215,10 @@ class ExtensionsServiceBackend
// Notify the frontend that the extension had already been installed.
void ReportExtensionVersionReinstalled(const std::string& id);
+ // Read the manifest from the front of the extension file.
+ // Caller takes ownership of return value.
+ DictionaryValue* ReadManifest(const FilePath& extension_path);
+
// Reads the Current Version file from |dir| into |version_string|.
bool ReadCurrentVersion(const FilePath& dir, std::string* version_string);