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

Issue 1873343002: [Policy] HostContentSettingsMap: Add AreUserExceptionsAllowedForType() and tests. (Closed)

Created:
4 years, 8 months ago by huangs
Modified:
4 years, 8 months ago
CC:
chromium-reviews, markusheintz_, msramek+watch_chromium.org, raymes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Policy] HostContentSettingsMap: Add AreUserExceptionsAllowedForType() and tests. Simple changes, with some refactoring: - Add AreUserExceptionsAllowedForType(). This interface will shortly be used by front end. - Store PrefProvider as typed member functions for ease of access. - Add 2 tests to HostContentSettingsMapTest (with supporting routines). - AreUserExceptionsAllowedForType: testing new interface. - PrefExceptionsOperation: testing how policy defaults can override user exceptions. Committed: https://crrev.com/3973014f0fbf36ec4a961e97273516b2ed1953d6 Cr-Commit-Position: refs/heads/master@{#388885}

Patch Set 1 #

Total comments: 23

Patch Set 2 : Sync. #

Patch Set 3 : Deferring GetDefaultContentSetting() change to another CL; removing TestUtils addition. #

Total comments: 2

Patch Set 4 : Fix comments. #

Total comments: 8

Patch Set 5 : Cleanups. #

Total comments: 8

Patch Set 6 : Make AreUserExceptionsAllowedForType() more general and use ProviderType directly. #

Total comments: 2

Patch Set 7 : Add DCHECK in AreUserExceptionsAllowedForType(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -21 lines) Patch
M chrome/browser/content_settings/host_content_settings_map_unittest.cc View 1 2 3 chunks +129 lines, -0 lines 0 comments Download
M components/content_settings/core/browser/host_content_settings_map.h View 1 2 3 4 5 5 chunks +13 lines, -3 lines 0 comments Download
M components/content_settings/core/browser/host_content_settings_map.cc View 1 2 3 4 5 6 8 chunks +35 lines, -18 lines 0 comments Download

Messages

Total messages: 56 (15 generated)
huangs
This CL extracts some content from https://codereview.chromium.org/1865803002/, and enables a number of relatively independent follow-ups: ...
4 years, 8 months ago (2016-04-11 21:37:33 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1873343002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1873343002/1
4 years, 8 months ago (2016-04-11 21:42:01 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-11 23:36:28 UTC) #7
raymes
Thanks! https://codereview.chromium.org/1873343002/diff/1/chrome/browser/content_settings/host_content_settings_map_unittest.cc File chrome/browser/content_settings/host_content_settings_map_unittest.cc (right): https://codereview.chromium.org/1873343002/diff/1/chrome/browser/content_settings/host_content_settings_map_unittest.cc#newcode55 chrome/browser/content_settings/host_content_settings_map_unittest.cc:55: class HostContentSettingsMapTester { Since these are specific to ...
4 years, 8 months ago (2016-04-12 04:52:47 UTC) #9
Bernhard Bauer
Before we go much further with this CL, I would like to consider the overall ...
4 years, 8 months ago (2016-04-12 09:30:05 UTC) #10
bartfab (slow)
On 2016/04/12 09:30:05, Bernhard Bauer wrote: > Before we go much further with this CL, ...
4 years, 8 months ago (2016-04-12 12:33:07 UTC) #11
Bernhard Bauer
On 2016/04/12 12:33:07, bartfab (slow) wrote: > On 2016/04/12 09:30:05, Bernhard Bauer wrote: > > ...
4 years, 8 months ago (2016-04-12 12:41:26 UTC) #12
bartfab (slow)
On 2016/04/12 12:41:26, Bernhard Bauer wrote: > On 2016/04/12 12:33:07, bartfab (slow) wrote: > > ...
4 years, 8 months ago (2016-04-12 12:45:20 UTC) #13
msramek
On 2016/04/12 12:45:20, bartfab (slow) wrote: > On 2016/04/12 12:41:26, Bernhard Bauer wrote: > > ...
4 years, 8 months ago (2016-04-12 12:58:06 UTC) #14
Bernhard Bauer
On 2016/04/12 12:45:20, bartfab (slow) wrote: > On 2016/04/12 12:41:26, Bernhard Bauer wrote: > > ...
4 years, 8 months ago (2016-04-12 13:00:52 UTC) #15
bartfab (slow)
On 2016/04/12 12:58:06, msramek wrote: > On 2016/04/12 12:45:20, bartfab (slow) wrote: > > On ...
4 years, 8 months ago (2016-04-12 13:12:41 UTC) #16
msramek
On 2016/04/12 13:00:52, Bernhard Bauer wrote: > On 2016/04/12 12:45:20, bartfab (slow) wrote: > > ...
4 years, 8 months ago (2016-04-12 13:20:19 UTC) #17
msramek
On 2016/04/12 13:12:41, bartfab (slow) wrote: > On 2016/04/12 12:58:06, msramek wrote: > > On ...
4 years, 8 months ago (2016-04-12 13:36:12 UTC) #18
bartfab (slow)
On 2016/04/12 13:36:12, msramek wrote: > On 2016/04/12 13:12:41, bartfab (slow) wrote: > > On ...
4 years, 8 months ago (2016-04-12 13:50:51 UTC) #19
huangs
Replying some comments for discussion, before changing code. Regarding recommended policy: this seems like the ...
4 years, 8 months ago (2016-04-12 14:19:14 UTC) #20
huangs
Updated and read for next round. PTAL. https://chromiumcodereview.appspot.com/1873343002/diff/1/chrome/browser/content_settings/host_content_settings_map_unittest.cc File chrome/browser/content_settings/host_content_settings_map_unittest.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/1/chrome/browser/content_settings/host_content_settings_map_unittest.cc#newcode55 chrome/browser/content_settings/host_content_settings_map_unittest.cc:55: class HostContentSettingsMapTester ...
4 years, 8 months ago (2016-04-13 17:36:18 UTC) #22
huangs
Updated and ready for next round. PTAL.
4 years, 8 months ago (2016-04-13 17:36:25 UTC) #23
huangs
Ping for review. Thanks!
4 years, 8 months ago (2016-04-14 23:55:47 UTC) #24
raymes
Overall this looks ok to me but I know Bernhard wanted to settle on the ...
4 years, 8 months ago (2016-04-18 05:16:48 UTC) #25
huangs
Updated, PTAL. Please note that this change is rather agnostic of whichever alternative we take. ...
4 years, 8 months ago (2016-04-18 21:02:06 UTC) #26
grt (UTC plus 2)
looks good https://codereview.chromium.org/1873343002/diff/60001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://codereview.chromium.org/1873343002/diff/60001/components/content_settings/core/browser/host_content_settings_map.cc#newcode156 components/content_settings/core/browser/host_content_settings_map.cc:156: pref_provider_ = nit: i find the double ...
4 years, 8 months ago (2016-04-19 01:57:34 UTC) #27
huangs
Updated. OWNER review for bauerb@, PTAL. https://chromiumcodereview.appspot.com/1873343002/diff/60001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/60001/components/content_settings/core/browser/host_content_settings_map.cc#newcode156 components/content_settings/core/browser/host_content_settings_map.cc:156: pref_provider_ = Done. ...
4 years, 8 months ago (2016-04-19 14:59:53 UTC) #28
Bernhard Bauer
https://codereview.chromium.org/1873343002/diff/1/components/content_settings/core/test/content_settings_test_utils.cc File components/content_settings/core/test/content_settings_test_utils.cc (right): https://codereview.chromium.org/1873343002/diff/1/components/content_settings/core/test/content_settings_test_utils.cc#newcode54 components/content_settings/core/test/content_settings_test_utils.cc:54: bool TestUtils::AddUserException(const std::string& pattern_string, On 2016/04/12 14:19:14, huangs wrote: ...
4 years, 8 months ago (2016-04-19 15:20:08 UTC) #29
Bernhard Bauer
https://codereview.chromium.org/1873343002/diff/1/components/content_settings/core/test/content_settings_test_utils.cc File components/content_settings/core/test/content_settings_test_utils.cc (right): https://codereview.chromium.org/1873343002/diff/1/components/content_settings/core/test/content_settings_test_utils.cc#newcode54 components/content_settings/core/test/content_settings_test_utils.cc:54: bool TestUtils::AddUserException(const std::string& pattern_string, On 2016/04/12 14:19:14, huangs wrote: ...
4 years, 8 months ago (2016-04-19 15:20:08 UTC) #30
huangs
Replied to comment, update to follow later today. https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; ...
4 years, 8 months ago (2016-04-20 15:20:32 UTC) #31
Bernhard Bauer
https://codereview.chromium.org/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://codereview.chromium.org/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; On 2016/04/20 15:20:32, huangs wrote: > Supvervised user ...
4 years, 8 months ago (2016-04-20 15:29:32 UTC) #32
huangs
https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; It might be easier if we just let ...
4 years, 8 months ago (2016-04-20 15:40:41 UTC) #33
Bernhard Bauer
https://codereview.chromium.org/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://codereview.chromium.org/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; On 2016/04/20 15:40:41, huangs wrote: > It might ...
4 years, 8 months ago (2016-04-20 15:53:24 UTC) #34
huangs
https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; Or we can just get the numerical index, ...
4 years, 8 months ago (2016-04-20 16:07:48 UTC) #35
Bernhard Bauer
https://codereview.chromium.org/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://codereview.chromium.org/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; On 2016/04/20 16:07:48, huangs wrote: > Or we ...
4 years, 8 months ago (2016-04-20 16:11:02 UTC) #36
huangs
Updated, PTAL. https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/80001/components/content_settings/core/browser/host_content_settings_map.cc#newcode261 components/content_settings/core/browser/host_content_settings_map.cc:261: kProviderNamesSourceMap[POLICY_PROVIDER].provider_name; Okay, did this using just numerical ...
4 years, 8 months ago (2016-04-20 17:55:53 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1873343002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1873343002/100001
4 years, 8 months ago (2016-04-20 22:13:56 UTC) #40
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_clobber_rel_ng/builds/162237)
4 years, 8 months ago (2016-04-20 22:46:41 UTC) #42
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1873343002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1873343002/100001
4 years, 8 months ago (2016-04-21 03:35:40 UTC) #44
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-21 03:56:21 UTC) #46
huangs
Ping for review. Thanks!
4 years, 8 months ago (2016-04-21 14:27:32 UTC) #47
Bernhard Bauer
LGTM https://codereview.chromium.org/1873343002/diff/100001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://codereview.chromium.org/1873343002/diff/100001/components/content_settings/core/browser/host_content_settings_map.cc#newcode271 components/content_settings/core/browser/host_content_settings_map.cc:271: if (content_setting == CONTENT_SETTING_DEFAULT) I think we could ...
4 years, 8 months ago (2016-04-21 15:20:12 UTC) #48
huangs
Thanks! Committing. https://chromiumcodereview.appspot.com/1873343002/diff/100001/components/content_settings/core/browser/host_content_settings_map.cc File components/content_settings/core/browser/host_content_settings_map.cc (right): https://chromiumcodereview.appspot.com/1873343002/diff/100001/components/content_settings/core/browser/host_content_settings_map.cc#newcode271 components/content_settings/core/browser/host_content_settings_map.cc:271: if (content_setting == CONTENT_SETTING_DEFAULT) Indeed, heh. Adding ...
4 years, 8 months ago (2016-04-21 19:39:36 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1873343002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1873343002/120001
4 years, 8 months ago (2016-04-21 19:40:28 UTC) #52
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 8 months ago (2016-04-21 20:37:59 UTC) #54
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:39:01 UTC) #56
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/3973014f0fbf36ec4a961e97273516b2ed1953d6
Cr-Commit-Position: refs/heads/master@{#388885}

Powered by Google App Engine
This is Rietveld 408576698