Index: chrome/browser/sync/glue/extension_backed_data_type_controller.cc |
diff --git a/chrome/browser/sync/glue/extension_backed_data_type_controller.cc b/chrome/browser/sync/glue/extension_backed_data_type_controller.cc |
index 7de4d7e732c1de49a12507d536253c1249c14164..b24d76927cf00b15986dbd058ad1e17417a00912 100644 |
--- a/chrome/browser/sync/glue/extension_backed_data_type_controller.cc |
+++ b/chrome/browser/sync/glue/extension_backed_data_type_controller.cc |
@@ -4,12 +4,12 @@ |
#include "chrome/browser/sync/glue/extension_backed_data_type_controller.h" |
-#include "base/sha1.h" |
#include "base/strings/string_number_conversions.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
#include "chrome/browser/sync/profile_sync_service.h" |
#include "chrome/browser/sync/profile_sync_service_factory.h" |
+#include "components/crx_file/id_util.h" |
#include "content/public/browser/browser_thread.h" |
#include "extensions/browser/extension_registry.h" |
#include "extensions/browser/extension_registry_factory.h" |
@@ -18,17 +18,6 @@ using content::BrowserThread; |
namespace browser_sync { |
-namespace { |
- |
-// Helper method to generate a hash from an extension id. |
-std::string IdToHash(const std::string extension_id) { |
- std::string hash = base::SHA1HashString(extension_id); |
- hash = base::HexEncode(hash.c_str(), hash.length()); |
- return hash; |
-} |
- |
-} // namespace |
- |
ExtensionBackedDataTypeController::ExtensionBackedDataTypeController( |
syncer::ModelType type, |
const std::string& extension_hash, |
@@ -108,7 +97,7 @@ bool ExtensionBackedDataTypeController::IsSyncingExtensionEnabled() const { |
bool ExtensionBackedDataTypeController::DoesExtensionMatch( |
const extensions::Extension& extension) const { |
- return IdToHash(extension.id()) == extension_hash_; |
+ return crx_file::id_util::HashedIdInHex(extension.id()) == extension_hash_; |
} |
bool ExtensionBackedDataTypeController::StartModels() { |