Commit 064ab3c7 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Migrate policy_conversions from DictionaryValue to Value

Also add safeguard checks as policy dump might be requested
by log upload job at times when not all services might be
available for the profile.

Bug: 863075
Change-Id: I45a88711c202800f89282dc0028e079bddb4324e
Reviewed-on: https://chromium-review.googlesource.com/1136533Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575649}
parent c2eaf985
This diff is collapsed.
......@@ -17,10 +17,9 @@ namespace policy {
// Returns a dictionary with the values of all set policies, with some values
// converted to be shown in javascript, if it is specified.
// |with_user_policies| governs if values with POLICY_SCOPE_USER are included.
std::unique_ptr<base::DictionaryValue> GetAllPolicyValuesAsDictionary(
content::BrowserContext* context,
bool with_user_policies,
bool convert_values);
base::Value GetAllPolicyValuesAsDictionary(content::BrowserContext* context,
bool with_user_policies,
bool convert_values);
// Returns a JSON with the values of all set policies.
// |with_user_policies| governs if values with POLICY_SCOPE_USER are included.
......
......@@ -735,12 +735,11 @@ void PolicyUIHandler::SendPolicyNames() const {
}
void PolicyUIHandler::SendPolicyValues() const {
std::unique_ptr<base::DictionaryValue> all_policies =
policy::GetAllPolicyValuesAsDictionary(
web_ui()->GetWebContents()->GetBrowserContext(),
true /* with_user_policies */, true /* convert_values */);
base::Value all_policies = policy::GetAllPolicyValuesAsDictionary(
web_ui()->GetWebContents()->GetBrowserContext(),
true /* with_user_policies */, true /* convert_values */);
web_ui()->CallJavascriptFunctionUnsafe("policy.Page.setPolicyValues",
*all_policies);
all_policies);
}
void PolicyUIHandler::SendStatus() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment