Index: chrome/test/live_sync/live_sync_extension_helper.h |
diff --git a/chrome/test/live_sync/live_sync_extension_helper.h b/chrome/test/live_sync/live_sync_extension_helper.h |
index 188d9b304492385891abfb4cca6ef51b53235c49..20b91605cd1ab788a15c80d1fb3cfe2e32aa8a13 100644 |
--- a/chrome/test/live_sync/live_sync_extension_helper.h |
+++ b/chrome/test/live_sync/live_sync_extension_helper.h |
@@ -20,10 +20,6 @@ class Profile; |
class LiveSyncExtensionHelper { |
public: |
- enum ExtensionState { DISABLED, PENDING, ENABLED }; |
- |
- typedef std::map<std::string, ExtensionState> ExtensionStateMap; |
- |
LiveSyncExtensionHelper(); |
~LiveSyncExtensionHelper(); |
@@ -41,6 +37,18 @@ class LiveSyncExtensionHelper { |
// Uninstalls the extension with the given name from |profile|. |
void UninstallExtension(Profile* profile, const std::string& name); |
+ // Enables the extension with the given name on |profile|. |
+ void EnableExtension(Profile* profile, const std::string& name); |
+ |
+ // Disables the extension with the given name on |profile|. |
+ void DisableExtension(Profile* profile, const std::string& name); |
+ |
+ // Enables the extension with the given name to run in incognito mode |
+ void IncognitoEnableExtension(Profile* profile, const std::string& name); |
+ |
+ // Disables the extension with the given name from running in incognito mode |
+ void IncognitoDisableExtension(Profile* profile, const std::string& name); |
+ |
// Returns true iff the extension with the given id is pending |
// install in |profile|. |
bool IsExtensionPendingInstallForSync( |
@@ -50,15 +58,27 @@ class LiveSyncExtensionHelper { |
// type. |
void InstallExtensionsPendingForSync(Profile* profile, Extension::Type type); |
- // Returns a map from |profile|'s installed extensions to their |
- // state. |
- ExtensionStateMap GetExtensionStates(Profile* profile) const; |
+ // Returns true iff |profile1| and |profile2| have the same extensions and |
+ // they are all in the same state. |
+ bool ExtensionStatesMatch(Profile* profile1, Profile* profile2) const; |
akalin
2011/06/10 01:56:44
I think this can be static
braffert
2011/06/10 16:49:17
Done. This required making the function non-const
|
private: |
+ struct ExtensionState { |
+ ExtensionState(); |
+ ~ExtensionState(); |
+ enum EnabledState { DISABLED, PENDING, ENABLED }; |
akalin
2011/06/10 01:56:44
Put types first, then blank line, then functions,
braffert
2011/06/10 16:49:17
Done.
|
+ bool Equals(const ExtensionState &other) const; |
+ EnabledState enabled_state; |
+ bool incognito_enabled; |
+ }; |
+ typedef std::map<std::string, ExtensionState> ExtensionStateMap; |
typedef std::map<std::string, scoped_refptr<Extension> > ExtensionNameMap; |
typedef std::map<Profile*, ExtensionNameMap> ProfileExtensionNameMap; |
typedef std::map<std::string, std::string> StringMap; |
+ // Returns a map from |profile|'s installed extensions to their state. |
+ ExtensionStateMap GetExtensionStates(Profile* profile) const; |
akalin
2011/06/10 01:56:44
I think this can be static
braffert
2011/06/10 16:49:17
Done.
|
+ |
// Initializes extensions for |profile| and creates an entry in |
// |profile_extensions_| for it. |
void SetupProfile(Profile* profile); |