#include "chrome/browser/sync/test/integration/sync_extension_helper.h"
#include <list>
#include <memory>
#include <utility>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/uuid.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/pending_extension_info.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/crx_file/id_util.h"
#include "components/sync/model/string_ordinal.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/install_flag.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
Extension;
ExtensionPrefs;
Manifest;
const char kFakeExtensionPrefix[] = …;
SyncExtensionHelper* SyncExtensionHelper::GetInstance() { … }
SyncExtensionHelper::SyncExtensionHelper() = default;
SyncExtensionHelper::~SyncExtensionHelper() = default;
void SyncExtensionHelper::SetupIfNecessary(SyncTest* test) { … }
std::string SyncExtensionHelper::InstallExtension(Profile* profile,
const std::string& name,
Manifest::Type type) { … }
void SyncExtensionHelper::UninstallExtension(Profile* profile,
const std::string& name) { … }
std::vector<std::string> SyncExtensionHelper::GetInstalledExtensionNames(
Profile* profile) const { … }
void SyncExtensionHelper::EnableExtension(Profile* profile,
const std::string& name) { … }
void SyncExtensionHelper::DisableExtension(Profile* profile,
const std::string& name) { … }
bool SyncExtensionHelper::IsExtensionEnabled(Profile* profile,
const std::string& name) const { … }
void SyncExtensionHelper::IncognitoEnableExtension(Profile* profile,
const std::string& name) { … }
void SyncExtensionHelper::IncognitoDisableExtension(Profile* profile,
const std::string& name) { … }
bool SyncExtensionHelper::IsIncognitoEnabled(Profile* profile,
const std::string& name) const { … }
bool SyncExtensionHelper::IsExtensionPendingInstallForSync(
Profile* profile,
const std::string& id) const { … }
void SyncExtensionHelper::InstallExtensionsPendingForSync(Profile* profile) { … }
SyncExtensionHelper::ExtensionStateMap SyncExtensionHelper::GetExtensionStates(
Profile* profile) { … }
bool SyncExtensionHelper::ExtensionStatesMatch(Profile* profile1,
Profile* profile2) { … }
std::string SyncExtensionHelper::CreateFakeExtensionName(int index) { … }
bool SyncExtensionHelper::ExtensionNameToIndex(const std::string& name,
int* index) { … }
void SyncExtensionHelper::SetupProfile(Profile* profile) { … }
namespace {
std::string NameToPublicKey(const std::string& name) { … }
scoped_refptr<Extension> CreateExtension(const base::FilePath& base_dir,
const std::string& name,
Manifest::Type type) { … }
}
scoped_refptr<Extension> SyncExtensionHelper::GetExtension(
Profile* profile,
const std::string& name,
Manifest::Type type) { … }