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

Issue 1061613002: chrome.settingsPrivate: Implement onPrefsChanged event handling. (Closed)

Created:
5 years, 8 months ago by Oren Blasberg
Modified:
5 years, 8 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Jeremy Klein
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Previously, onPrefsChanged was a no op. This CL implements functionality for notifying listeners on the event when a pref has changed. In the process: - pull out shared logic into a prefs util namespace. - simplify the whitelisting logic so there is only one GetWhitelistedPrefs method and not a CrOS-specific one. BUG=468093 Committed: https://crrev.com/a22ce7ae22a39dd3c1693a082b727a4d725fe306 Cr-Commit-Position: refs/heads/master@{#324083}

Patch Set 1 #

Patch Set 2 : Add onPrefsChanged event handler. #

Patch Set 3 : All the events work now #

Patch Set 4 : Simplified Cros specific logic #

Patch Set 5 : Some cleanups #

Patch Set 6 : #

Patch Set 7 : Fix copyright headers to say 2015 #

Total comments: 8

Patch Set 8 : Respond to Steven's comments + add an APItest #

Total comments: 6

Patch Set 9 : Respond to nits #

Patch Set 10 : Fix a direct memory leak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+449 lines, -344 lines) Patch
A chrome/browser/extensions/api/settings_private/prefs_util.h View 1 2 3 4 5 6 7 8 1 chunk +48 lines, -0 lines 0 comments Download
A + chrome/browser/extensions/api/settings_private/prefs_util.cc View 1 2 3 4 5 6 7 8 6 chunks +42 lines, -156 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/settings_private_apitest.cc View 1 2 3 4 5 6 7 3 chunks +11 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/settings_private_delegate.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/settings_private_delegate.cc View 1 2 3 4 chunks +8 lines, -178 lines 0 comments Download
A chrome/browser/extensions/api/settings_private/settings_private_event_router.h View 1 2 3 1 chunk +66 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/settings_private/settings_private_event_router.cc View 1 2 3 4 5 6 7 8 9 1 chunk +134 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/settings_private/settings_private_event_router_factory.h View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/settings_private/settings_private_event_router_factory.cc View 1 2 3 4 5 1 chunk +59 lines, -0 lines 0 comments Download
M chrome/browser/extensions/browser_context_keyed_service_factories.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/settings_private.idl View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/data/extensions/api_test/settings_private/test.js View 1 2 3 4 5 6 7 3 chunks +18 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
Oren Blasberg
Hey Steven, The code is working and ready -- while I work on tests can ...
5 years, 8 months ago (2015-04-06 20:43:52 UTC) #2
stevenjb
Nice. Looking good. https://codereview.chromium.org/1061613002/diff/120001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1061613002/diff/120001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode54 chrome/browser/extensions/api/settings_private/prefs_util.cc:54: bool IsPrefUserModifiable(Profile* profile, const std::string& pref_name) ...
5 years, 8 months ago (2015-04-06 22:40:59 UTC) #3
Oren Blasberg
Thanks! I also added a test that exercises the event router code path. I had ...
5 years, 8 months ago (2015-04-06 23:27:07 UTC) #4
Oren Blasberg
+Ben: Could you please take a look at the IDL? It's a one line change. ...
5 years, 8 months ago (2015-04-06 23:29:24 UTC) #6
stevenjb
lgtm https://codereview.chromium.org/1061613002/diff/140001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1061613002/diff/140001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode119 chrome/browser/extensions/api/settings_private/prefs_util.cc:119: } nit: no {} https://codereview.chromium.org/1061613002/diff/140001/chrome/browser/extensions/api/settings_private/prefs_util.h File chrome/browser/extensions/api/settings_private/prefs_util.h (right): ...
5 years, 8 months ago (2015-04-06 23:33:38 UTC) #7
not at google - send to devlin
lgtm
5 years, 8 months ago (2015-04-06 23:37:34 UTC) #8
Oren Blasberg
https://codereview.chromium.org/1061613002/diff/140001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/1061613002/diff/140001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode119 chrome/browser/extensions/api/settings_private/prefs_util.cc:119: } On 2015/04/06 23:33:38, stevenjb wrote: > nit: no ...
5 years, 8 months ago (2015-04-06 23:41:30 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1061613002/160001
5 years, 8 months ago (2015-04-06 23:42:05 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel/builds/52776)
5 years, 8 months ago (2015-04-07 02:10:01 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1061613002/180001
5 years, 8 months ago (2015-04-07 18:19:08 UTC) #17
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 8 months ago (2015-04-07 19:10:45 UTC) #18
commit-bot: I haz the power
5 years, 8 months ago (2015-04-07 19:11:41 UTC) #19
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/a22ce7ae22a39dd3c1693a082b727a4d725fe306
Cr-Commit-Position: refs/heads/master@{#324083}

Powered by Google App Engine
This is Rietveld 408576698