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

Issue 1372353004: Making structure for ContentSettings and its corresponding strings. (Closed)

Created:
5 years, 2 months ago by Deepak
Modified:
5 years, 2 months ago
CC:
chromium-reviews, markusheintz_, 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

Making structure entry for ContentSetting and corresponding strings for better understanding and maintainability for conversion from ContentSetting to string and vise a versa. BUG=538138 Committed: https://crrev.com/c1d73e5f7f0b38057d41bf78d282da4521f1fdc8 Cr-Commit-Position: refs/heads/master@{#353226}

Patch Set 1 #

Patch Set 2 : updating variable name. #

Total comments: 10

Patch Set 3 : Changes as per review comments. #

Patch Set 4 : Adding Test Case. #

Total comments: 2

Patch Set 5 : Changes as per review comments. #

Total comments: 4

Patch Set 6 : Changes as per review comments. #

Total comments: 4

Patch Set 7 : Changes as per review comments. #

Total comments: 4

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : Changes as per review comments. #

Patch Set 12 : Changes as per review comments. #

Patch Set 13 : #

Total comments: 13

Patch Set 14 : Changes as per review comments. #

Patch Set 15 : #

Total comments: 14

Patch Set 16 : Changes as per review comments. #

Total comments: 12

Patch Set 17 : Changes as per review comments. #

Patch Set 18 : #

Patch Set 19 : #

Total comments: 4

Patch Set 20 : #

Total comments: 2

Patch Set 21 : Removing chnages from pref_service_bridge.cc file. #

Total comments: 4

Patch Set 22 : Addressing nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -102 lines) Patch
M chrome/browser/extensions/api/content_settings/content_settings_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/content_settings/content_settings_helpers.h View 1 2 3 4 5 6 8 9 10 11 12 13 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/content_settings/content_settings_helpers.cc View 1 2 3 4 5 6 8 9 10 11 12 13 2 chunks +0 lines, -29 lines 0 comments Download
M chrome/browser/extensions/api/content_settings/content_settings_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/resources/options/content_settings.html View 1 2 3 4 5 6 7 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/resources/options/content_settings_exceptions_area.js View 1 2 3 4 5 6 9 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/options/content_settings_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +56 lines, -12 lines 0 comments Download
M chrome/test/data/policy/policy_test_cases.json View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M components/content_settings/core/browser/content_settings_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 16 1 chunk +3 lines, -1 line 0 comments Download
M components/content_settings/core/browser/content_settings_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +33 lines, -31 lines 0 comments Download
M components/content_settings/core/browser/content_settings_utils_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +37 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (4 generated)
Deepak
PTAL
5 years, 2 months ago (2015-10-01 13:19:14 UTC) #2
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/20001/components/content_settings/core/browser/content_settings_utils.cc File components/content_settings/core/browser/content_settings_utils.cc (right): https://codereview.chromium.org/1372353004/diff/20001/components/content_settings/core/browser/content_settings_utils.cc#newcode28 components/content_settings/core/browser/content_settings_utils.cc:28: struct ContentSettingsToFromString { Nit: ContentSettingsStringMapping might be better. Same ...
5 years, 2 months ago (2015-10-01 14:36:09 UTC) #3
Deepak
Thanks for review. Changes done as suggested. PTAL https://codereview.chromium.org/1372353004/diff/20001/components/content_settings/core/browser/content_settings_utils.cc File components/content_settings/core/browser/content_settings_utils.cc (right): https://codereview.chromium.org/1372353004/diff/20001/components/content_settings/core/browser/content_settings_utils.cc#newcode28 components/content_settings/core/browser/content_settings_utils.cc:28: struct ...
5 years, 2 months ago (2015-10-03 09:02:12 UTC) #4
Bernhard Bauer
BTW, there is also a ContentSettingToString method in chrome/browser/extensions/api/content_settings/content_settings_helpers.h; it might make sense to unify ...
5 years, 2 months ago (2015-10-05 08:15:10 UTC) #5
Deepak
PTAL https://codereview.chromium.org/1372353004/diff/60001/components/content_settings/core/browser/content_settings_utils.cc File components/content_settings/core/browser/content_settings_utils.cc (right): https://codereview.chromium.org/1372353004/diff/60001/components/content_settings/core/browser/content_settings_utils.cc#newcode56 components/content_settings/core/browser/content_settings_utils.cc:56: for (size_t i = 1; i < arraysize(kContentSettingsStringMapping); ...
5 years, 2 months ago (2015-10-05 09:51:30 UTC) #6
Bernhard Bauer
Thanks for the yak shaving! https://codereview.chromium.org/1372353004/diff/80001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc File chrome/browser/extensions/api/content_settings/content_settings_helpers.cc (left): https://codereview.chromium.org/1372353004/diff/80001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc#oldcode27 chrome/browser/extensions/api/content_settings/content_settings_helpers.cc:27: "session_only", We are probably ...
5 years, 2 months ago (2015-10-05 11:15:41 UTC) #7
Deepak
Please correct me if I misunderstood something. Rest changes done. PTAL. https://codereview.chromium.org/1372353004/diff/80001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc File chrome/browser/extensions/api/content_settings/content_settings_helpers.cc (left): ...
5 years, 2 months ago (2015-10-05 12:14:38 UTC) #8
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/100001/chrome/browser/android/preferences/pref_service_bridge.cc File chrome/browser/android/preferences/pref_service_bridge.cc (right): https://codereview.chromium.org/1372353004/diff/100001/chrome/browser/android/preferences/pref_service_bridge.cc#newcode88 chrome/browser/android/preferences/pref_service_bridge.cc:88: return "session_only"; I think you need to update the ...
5 years, 2 months ago (2015-10-05 12:34:29 UTC) #9
Deepak
PTAL https://codereview.chromium.org/1372353004/diff/100001/chrome/browser/android/preferences/pref_service_bridge.cc File chrome/browser/android/preferences/pref_service_bridge.cc (right): https://codereview.chromium.org/1372353004/diff/100001/chrome/browser/android/preferences/pref_service_bridge.cc#newcode88 chrome/browser/android/preferences/pref_service_bridge.cc:88: return "session_only"; On 2015/10/05 12:34:28, Bernhard Bauer wrote: ...
5 years, 2 months ago (2015-10-05 14:25:32 UTC) #10
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/120001/chrome/browser/extensions/api/content_settings/content_settings_api.cc File chrome/browser/extensions/api/content_settings/content_settings_api.cc (right): https://codereview.chromium.org/1372353004/diff/120001/chrome/browser/extensions/api/content_settings/content_settings_api.cc#newcode212 chrome/browser/extensions/api/content_settings/content_settings_api.cc:212: DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); Sorry, this is the wrong way around ...
5 years, 2 months ago (2015-10-05 14:31:48 UTC) #11
Deepak
++ Adding AKV for Peer review. https://codereview.chromium.org/1372353004/diff/120001/chrome/browser/extensions/api/content_settings/content_settings_api.cc File chrome/browser/extensions/api/content_settings/content_settings_api.cc (right): https://codereview.chromium.org/1372353004/diff/120001/chrome/browser/extensions/api/content_settings/content_settings_api.cc#newcode212 chrome/browser/extensions/api/content_settings/content_settings_api.cc:212: DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); On ...
5 years, 2 months ago (2015-10-06 15:18:41 UTC) #13
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/240001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc File chrome/browser/extensions/api/content_settings/content_settings_helpers.cc (right): https://codereview.chromium.org/1372353004/diff/240001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc#newcode113 chrome/browser/extensions/api/content_settings/content_settings_helpers.cc:113: *setting = content_settings::ContentSettingFromString(setting_str); This is still incorrect. ContentSettingFromString will ...
5 years, 2 months ago (2015-10-06 15:37:25 UTC) #14
AKV
Please check my inline comments https://codereview.chromium.org/1372353004/diff/240001/components/content_settings/core/browser/content_settings_utils_unittest.cc File components/content_settings/core/browser/content_settings_utils_unittest.cc (right): https://codereview.chromium.org/1372353004/diff/240001/components/content_settings/core/browser/content_settings_utils_unittest.cc#newcode50 components/content_settings/core/browser/content_settings_utils_unittest.cc:50: EXPECT_EQ("default", If we define ...
5 years, 2 months ago (2015-10-06 16:01:38 UTC) #15
Deepak
@Bernhard & @AKV Thanks for review. All suggestions accommodated. PTAL https://codereview.chromium.org/1372353004/diff/240001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc File chrome/browser/extensions/api/content_settings/content_settings_helpers.cc (right): https://codereview.chromium.org/1372353004/diff/240001/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc#newcode113 ...
5 years, 2 months ago (2015-10-07 04:39:43 UTC) #16
AKV
Thanks. peer review looks good to me!
5 years, 2 months ago (2015-10-07 06:19:17 UTC) #17
Deepak
On 2015/10/07 06:19:17, AKV wrote: > Thanks. > peer review looks good to me! @AKV ...
5 years, 2 months ago (2015-10-07 06:29:40 UTC) #18
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/240001/components/content_settings/core/browser/content_settings_utils_unittest.cc File components/content_settings/core/browser/content_settings_utils_unittest.cc (right): https://codereview.chromium.org/1372353004/diff/240001/components/content_settings/core/browser/content_settings_utils_unittest.cc#newcode60 components/content_settings/core/browser/content_settings_utils_unittest.cc:60: EXPECT_EQ("detect_important_content", On 2015/10/07 04:39:43, Deepak wrote: > On 2015/10/06 ...
5 years, 2 months ago (2015-10-07 09:32:04 UTC) #19
Deepak
@bauerb Thanks for review, Changes done. PTAL. https://codereview.chromium.org/1372353004/diff/280001/components/content_settings/core/browser/content_settings_utils.cc File components/content_settings/core/browser/content_settings_utils.cc (right): https://codereview.chromium.org/1372353004/diff/280001/components/content_settings/core/browser/content_settings_utils.cc#newcode65 components/content_settings/core/browser/content_settings_utils.cc:65: NOTREACHED() << ...
5 years, 2 months ago (2015-10-07 11:12:25 UTC) #20
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/300001/chrome/browser/android/preferences/pref_service_bridge.cc File chrome/browser/android/preferences/pref_service_bridge.cc (right): https://codereview.chromium.org/1372353004/diff/300001/chrome/browser/android/preferences/pref_service_bridge.cc#newcode78 chrome/browser/android/preferences/pref_service_bridge.cc:78: std::string GetStringForContentSettingsType( Thanks for finding these! I took a ...
5 years, 2 months ago (2015-10-07 11:38:21 UTC) #21
Deepak
Changes done as suggested. PTAL https://codereview.chromium.org/1372353004/diff/300001/chrome/browser/android/preferences/pref_service_bridge.cc File chrome/browser/android/preferences/pref_service_bridge.cc (right): https://codereview.chromium.org/1372353004/diff/300001/chrome/browser/android/preferences/pref_service_bridge.cc#newcode78 chrome/browser/android/preferences/pref_service_bridge.cc:78: std::string GetStringForContentSettingsType( On 2015/10/07 ...
5 years, 2 months ago (2015-10-07 13:54:43 UTC) #22
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/360001/chrome/browser/extensions/api/content_settings/content_settings_api.cc File chrome/browser/extensions/api/content_settings/content_settings_api.cc (right): https://codereview.chromium.org/1372353004/diff/360001/chrome/browser/extensions/api/content_settings/content_settings_api.cc#newcode244 chrome/browser/extensions/api/content_settings/content_settings_api.cc:244: setting_str = content_settings::ContentSettingToString(setting); This is unnecessary -- You get ...
5 years, 2 months ago (2015-10-07 15:05:44 UTC) #23
Deepak
PTAL https://codereview.chromium.org/1372353004/diff/360001/chrome/browser/extensions/api/content_settings/content_settings_api.cc File chrome/browser/extensions/api/content_settings/content_settings_api.cc (right): https://codereview.chromium.org/1372353004/diff/360001/chrome/browser/extensions/api/content_settings/content_settings_api.cc#newcode244 chrome/browser/extensions/api/content_settings/content_settings_api.cc:244: setting_str = content_settings::ContentSettingToString(setting); On 2015/10/07 15:05:44, Bernhard Bauer ...
5 years, 2 months ago (2015-10-07 15:17:18 UTC) #24
Bernhard Bauer
https://codereview.chromium.org/1372353004/diff/380001/chrome/browser/android/preferences/pref_service_bridge.cc File chrome/browser/android/preferences/pref_service_bridge.cc (right): https://codereview.chromium.org/1372353004/diff/380001/chrome/browser/android/preferences/pref_service_bridge.cc#newcode88 chrome/browser/android/preferences/pref_service_bridge.cc:88: return "session_only"; Can you revert the changes in this ...
5 years, 2 months ago (2015-10-07 15:30:16 UTC) #25
Deepak
PTAL https://codereview.chromium.org/1372353004/diff/380001/chrome/browser/android/preferences/pref_service_bridge.cc File chrome/browser/android/preferences/pref_service_bridge.cc (right): https://codereview.chromium.org/1372353004/diff/380001/chrome/browser/android/preferences/pref_service_bridge.cc#newcode88 chrome/browser/android/preferences/pref_service_bridge.cc:88: return "session_only"; On 2015/10/07 15:30:16, Bernhard Bauer wrote: ...
5 years, 2 months ago (2015-10-08 06:14:53 UTC) #26
Bernhard Bauer
A last set of nits (sorry I missed those earlier): https://codereview.chromium.org/1372353004/diff/400001/components/content_settings/core/browser/content_settings_utils_unittest.cc File components/content_settings/core/browser/content_settings_utils_unittest.cc (right): https://codereview.chromium.org/1372353004/diff/400001/components/content_settings/core/browser/content_settings_utils_unittest.cc#newcode68 ...
5 years, 2 months ago (2015-10-08 09:32:46 UTC) #27
Deepak
Nit Addressed. PTAL Thanks https://codereview.chromium.org/1372353004/diff/400001/components/content_settings/core/browser/content_settings_utils_unittest.cc File components/content_settings/core/browser/content_settings_utils_unittest.cc (right): https://codereview.chromium.org/1372353004/diff/400001/components/content_settings/core/browser/content_settings_utils_unittest.cc#newcode68 components/content_settings/core/browser/content_settings_utils_unittest.cc:68: for (size_t type = 0; ...
5 years, 2 months ago (2015-10-08 10:48:15 UTC) #28
Bernhard Bauer
LGTM, thanks!
5 years, 2 months ago (2015-10-08 11:05:29 UTC) #29
Deepak
@Bernhard Thanks. @Ken Rockot Please give approval for chrome/browser/extensions/api/content_settings/* Thanks
5 years, 2 months ago (2015-10-08 11:13:21 UTC) #31
Ken Rockot(use gerrit already)
extensions lgtm
5 years, 2 months ago (2015-10-08 23:23:20 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1372353004/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1372353004/420001
5 years, 2 months ago (2015-10-09 02:47:24 UTC) #34
commit-bot: I haz the power
Committed patchset #22 (id:420001)
5 years, 2 months ago (2015-10-09 04:04:23 UTC) #35
commit-bot: I haz the power
5 years, 2 months ago (2015-10-09 04:05:04 UTC) #36
Message was sent while issue was closed.
Patchset 22 (id:??) landed as
https://crrev.com/c1d73e5f7f0b38057d41bf78d282da4521f1fdc8
Cr-Commit-Position: refs/heads/master@{#353226}

Powered by Google App Engine
This is Rietveld 408576698