Index: chrome/browser/ui/webui/local_state/local_state_ui.cc |
diff --git a/chrome/browser/ui/webui/local_state/local_state_ui.cc b/chrome/browser/ui/webui/local_state/local_state_ui.cc |
index 22740b170aed2da1de510627ecdb5e800432cc78..1a5f411f77ff85075e446ff2f4a958dbba0e60d2 100644 |
--- a/chrome/browser/ui/webui/local_state/local_state_ui.cc |
+++ b/chrome/browser/ui/webui/local_state/local_state_ui.cc |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/url_constants.h" |
#include "components/prefs/pref_service.h" |
+#include "components/variations/pref_names.h" |
#include "content/public/browser/web_ui.h" |
#include "content/public/browser/web_ui_controller.h" |
#include "content/public/browser/web_ui_data_source.h" |
@@ -51,10 +52,16 @@ void LocalStateUIHandler::RegisterMessages() { |
} |
void LocalStateUIHandler::HandleRequestJson(const base::ListValue* args) { |
-#if !defined(OS_CHROMEOS) |
+#if defined(OS_CHROMEOS) |
+ std::vector<std::string> whitelisted_prefixes = { |
+ "variations", "user_experience_metrics", "uninstall_metrics"}; |
+ std::unique_ptr<base::DictionaryValue> local_state_values( |
+ g_browser_process->local_state() |
+ ->GetWhitelistedPreferenceValuesOmitDefaults(whitelisted_prefixes)); |
Bernhard Bauer
2016/04/22 18:24:38
Couldn't we just do the whitelisting here? We woul
hamelphi
2016/04/22 20:31:28
I was on the fence between doing the filtering her
|
+#else |
std::unique_ptr<base::DictionaryValue> local_state_values( |
g_browser_process->local_state()->GetPreferenceValuesOmitDefaults()); |
- |
+#endif // !defined(OS_CHROMEOS) |
std::string json; |
JSONStringValueSerializer serializer(&json); |
serializer.set_pretty_print(true); |
@@ -64,7 +71,6 @@ void LocalStateUIHandler::HandleRequestJson(const base::ListValue* args) { |
web_ui()->CallJavascriptFunction("localState.setLocalState", |
base::StringValue(json)); |
-#endif // !defined(OS_CHROMEOS) |
} |
} // namespace |