| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SYNC_TEST_LIVE_SYNC_EXTENSIONS_HELPER_H_ | |
| 6 #define CHROME_BROWSER_SYNC_TEST_LIVE_SYNC_EXTENSIONS_HELPER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/compiler_specific.h" | |
| 14 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | |
| 15 | |
| 16 class Profile; | |
| 17 | |
| 18 namespace extensions_helper { | |
| 19 | |
| 20 // Returns true iff the profile with index |index| has the same extensions | |
| 21 // as the verifier. | |
| 22 bool HasSameExtensionsAsVerifier(int index) WARN_UNUSED_RESULT; | |
| 23 | |
| 24 // Returns true iff all existing profiles have the same extensions | |
| 25 // as the verifier. | |
| 26 bool AllProfilesHaveSameExtensionsAsVerifier() WARN_UNUSED_RESULT; | |
| 27 | |
| 28 // Returns true iff all existing profiles have the same extensions. | |
| 29 bool AllProfilesHaveSameExtensions() WARN_UNUSED_RESULT; | |
| 30 | |
| 31 // Installs the extension for the given index to |profile|. | |
| 32 void InstallExtension(Profile* profile, int index); | |
| 33 | |
| 34 // Uninstalls the extension for the given index from |profile|. Assumes that | |
| 35 // it was previously installed. | |
| 36 void UninstallExtension(Profile* profile, int index); | |
| 37 | |
| 38 // Returns a vector containing the indices of all currently installed | |
| 39 // test extensions on |profile|. | |
| 40 std::vector<int> GetInstalledExtensions(Profile* profile); | |
| 41 | |
| 42 // Installs all pending synced extensions for |profile|. | |
| 43 void InstallExtensionsPendingForSync(Profile* profile); | |
| 44 | |
| 45 // Enables the extension for the given index on |profile|. | |
| 46 void EnableExtension(Profile* profile, int index); | |
| 47 | |
| 48 // Disables the extension for the given index on |profile|. | |
| 49 void DisableExtension(Profile* profile, int index); | |
| 50 | |
| 51 // Returns true if the extension with index |index| is enabled on |profile|. | |
| 52 bool IsExtensionEnabled(Profile* profile, int index); | |
| 53 | |
| 54 // Enables the extension for the given index in incognito mode on |profile|. | |
| 55 void IncognitoEnableExtension(Profile* profile, int index); | |
| 56 | |
| 57 // Disables the extension for the given index in incognito mode on |profile|. | |
| 58 void IncognitoDisableExtension(Profile* profile, int index); | |
| 59 | |
| 60 // Returns true if the extension with index |index| is enabled in incognito | |
| 61 // mode on |profile|. | |
| 62 bool IsIncognitoEnabled(Profile* profile, int index); | |
| 63 | |
| 64 // Returns a unique extension name based in the integer |index|. | |
| 65 std::string CreateFakeExtensionName(int index); | |
| 66 | |
| 67 // Converts a fake extension name back into the index used to generate it. | |
| 68 // Returns true if successful, false on failure. | |
| 69 bool ExtensionNameToIndex(const std::string& name, int* index); | |
| 70 | |
| 71 } // namespace extensions_helper | |
| 72 | |
| 73 #endif // CHROME_BROWSER_SYNC_TEST_LIVE_SYNC_EXTENSIONS_HELPER_H_ | |
| OLD | NEW |