Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Unified Diff: chrome/browser/extensions/policy_handlers.cc

Issue 481433005: Extensions: Move id_util functions to crx_file component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert last patchset. function returns Extension* and can't use an assert. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/policy_handlers.cc
diff --git a/chrome/browser/extensions/policy_handlers.cc b/chrome/browser/extensions/policy_handlers.cc
index 3508faeb51b6bafba457f2010f43cd66370453e5..e47b29f332d849f3009b9ceeb563174e0435bf16 100644
--- a/chrome/browser/extensions/policy_handlers.cc
+++ b/chrome/browser/extensions/policy_handlers.cc
@@ -8,6 +8,7 @@
#include "base/prefs/pref_value_map.h"
#include "chrome/browser/extensions/external_policy_loader.h"
#include "chrome/common/pref_names.h"
+#include "components/crx_file/id_util.h"
#include "components/policy/core/browser/policy_error_map.h"
#include "components/policy/core/common/policy_map.h"
#include "extensions/browser/pref_names.h"
@@ -79,8 +80,7 @@ bool ExtensionListPolicyHandler::CheckAndGetList(
ValueTypeToString(base::Value::TYPE_STRING));
continue;
}
- if (!(allow_wildcards_ && id == "*") &&
- !extensions::Extension::IdIsValid(id)) {
+ if (!(allow_wildcards_ && id == "*") && !crx_file::id_util::IdIsValid(id)) {
errors->AddError(policy_name(),
entry - list_value->begin(),
IDS_POLICY_VALUE_FORMAT_ERROR);
@@ -166,7 +166,7 @@ bool ExtensionInstallForcelistPolicyHandler::ParseList(
std::string extension_id = entry_string.substr(0, pos);
std::string update_url = entry_string.substr(pos+1);
- if (!extensions::Extension::IdIsValid(extension_id) ||
+ if (!crx_file::id_util::IdIsValid(extension_id) ||
!GURL(update_url).is_valid()) {
if (errors) {
errors->AddError(policy_name(),
« no previous file with comments | « chrome/browser/extensions/external_registry_loader_win.cc ('k') | chrome/browser/extensions/sandboxed_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698