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

Unified Diff: chrome/browser/ui/webui/local_state/local_state_ui.cc

Issue 1910323002: Allow whitelisted prefs to be displayed in ChromeOS in chrome://local-state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | components/prefs/pref_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | components/prefs/pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698