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

Issue 11186002: Add a SafeSearch preference, policy and implementation. (Closed)

Created:
8 years, 2 months ago by Sergiu
Modified:
8 years, 1 month ago
CC:
chromium-reviews, Aaron Boodman, cbentzel+watch_chromium.org, mihaip-chromium-reviews_chromium.org, darin-cc_chromium.org, Bernhard Bauer
Visibility:
Public.

Description

Add a SafeSearch preference, policy and implementation. When the SafeSearch preference is set and the user searches on Google the safe=active&ssui=on parameters are added at the end of the query if they are not already set to the correct value. We do this after the request was handled by extensions. Also added a policy tied to the SafeSearch preference and both unit tests for the SafeSearch code and browser tests for the policy part. TBR=thakis@chromium.org BUG=159241 TEST=Included unit and browser tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=166656

Patch Set 1 #

Patch Set 2 : Add a SafeSearch preference, policy and implementation. #

Total comments: 82

Patch Set 3 : Updated version with improvements and new mechanism. #

Total comments: 22

Patch Set 4 : Fine grain parameter match + more tests. #

Total comments: 30

Patch Set 5 : Minor fixes and refactoring from comments #

Total comments: 24

Patch Set 6 : More improvements based on comments. #

Patch Set 7 : Minor fixes that got by the last patch set. #

Total comments: 34

Patch Set 8 : Changes suggested by comments. #

Total comments: 13

Patch Set 9 : Minor last changes. Merged with the latest version from the tree. #

Total comments: 6

Patch Set 10 : Minor improvement and bugfix. #

Total comments: 4

Patch Set 11 : Removed SupportsSafeSearch from google_util. #

Total comments: 1

Patch Set 12 : Improved SafeSearch policy test to prevent flakyness. #

Patch Set 13 : Removed an extra line. #

Patch Set 14 : Disable the policy unittest until we resolve the flakyness on trybots. #

Patch Set 15 : Added IO thread to unit test. #

Patch Set 16 : Policy browser test improvements. #

Patch Set 17 : Rebased with the latest tree version #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+458 lines, -9 lines) Patch
M chrome/app/policy/policy_templates.json View 1 2 3 4 5 6 7 8 2 chunks +19 lines, -1 line 1 comment Download
M chrome/browser/extensions/api/web_request/web_request_api_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/io_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate.h View 1 2 3 4 5 6 7 8 9 5 chunks +13 lines, -3 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +101 lines, -2 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +203 lines, -1 line 0 comments Download
M chrome/browser/policy/configuration_policy_handler_list.cc View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/policy/configuration_policy_pref_store_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/policy/policy_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +87 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/common/url_constants.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/common/url_constants.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/test/data/policy/policy_test_cases.json View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (0 generated)
Sergiu
Comments/observations are welcome. Please try this on the trybots on my behalf as well.
8 years, 2 months ago (2012-10-16 15:39:48 UTC) #1
battre
some first feedback... have to catch a plane now. https://codereview.chromium.org/11186002/diff/6001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/11186002/diff/6001/chrome/browser/net/chrome_network_delegate.cc#newcode234 chrome/browser/net/chrome_network_delegate.cc:234: ...
8 years, 2 months ago (2012-10-16 16:05:48 UTC) #2
Joao da Silva
The policy changes look good to me (nice test there!). I've left a couple other ...
8 years, 2 months ago (2012-10-16 16:26:46 UTC) #3
Bernhard Bauer
https://codereview.chromium.org/11186002/diff/6001/chrome/app/policy/policy_templates.json File chrome/app/policy/policy_templates.json (right): https://codereview.chromium.org/11186002/diff/6001/chrome/app/policy/policy_templates.json#newcode560 chrome/app/policy/policy_templates.json:560: 'name': 'SafeSearchEnabled', I would be happier if we called ...
8 years, 2 months ago (2012-10-16 16:37:33 UTC) #4
Elliot Glaysher
+willchan Will, I've done a quick pass over the ProfileIOData modifications, and I don't think ...
8 years, 2 months ago (2012-10-16 21:27:54 UTC) #5
willchan no longer on Chromium
ProfileIOData changes look kosher to me.
8 years, 2 months ago (2012-10-16 22:27:01 UTC) #6
willchan no longer on Chromium
+mmenke since you're going to want his c/b/n/ approval later.
8 years, 2 months ago (2012-10-16 22:32:25 UTC) #7
Elliot Glaysher
then the profile changes lgtm2 (I echo requests that references in code should be named ...
8 years, 2 months ago (2012-10-16 22:33:00 UTC) #8
Pam (message me for reviews)
https://codereview.chromium.org/11186002/diff/6001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): https://codereview.chromium.org/11186002/diff/6001/chrome/browser/net/chrome_network_delegate.cc#newcode301 chrome/browser/net/chrome_network_delegate.cc:301: // If the request has been modified by the ...
8 years, 2 months ago (2012-10-17 11:37:37 UTC) #9
Sergiu
Changed the way the check is done, updated variable/constant names to better variants and various ...
8 years, 2 months ago (2012-10-17 14:48:58 UTC) #10
Bernhard Bauer
http://codereview.chromium.org/11186002/diff/12002/chrome/app/policy/policy_templates.json File chrome/app/policy/policy_templates.json (right): http://codereview.chromium.org/11186002/diff/12002/chrome/app/policy/policy_templates.json#newcode571 chrome/app/policy/policy_templates.json:571: 'desc': '''Forces users to do queries in Google Web ...
8 years, 2 months ago (2012-10-17 15:23:54 UTC) #11
Sergiu
Updated the code with an individual check of the parameters, plus removing parameters set to ...
8 years, 2 months ago (2012-10-19 08:40:55 UTC) #12
battre
Just a quick, non-exhaustive review. http://codereview.chromium.org/11186002/diff/5004/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/5004/chrome/browser/net/chrome_network_delegate.cc#newcode94 chrome/browser/net/chrome_network_delegate.cc:94: void ForceGoogleSafeSearchCallbackWrapper( Please add ...
8 years, 2 months ago (2012-10-19 09:02:34 UTC) #13
Joao da Silva
http://codereview.chromium.org/11186002/diff/5004/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/5004/chrome/browser/net/chrome_network_delegate.cc#newcode99 chrome/browser/net/chrome_network_delegate.cc:99: if (rv == net::OK && new_url->is_empty()) If the extension ...
8 years, 2 months ago (2012-10-19 10:00:38 UTC) #14
Sergiu
Fixed the previous comments, extra feedback is welcome :) http://codereview.chromium.org/11186002/diff/5004/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/5004/chrome/browser/net/chrome_network_delegate.cc#newcode94 chrome/browser/net/chrome_network_delegate.cc:94: ...
8 years, 2 months ago (2012-10-19 12:00:18 UTC) #15
Bernhard Bauer
http://codereview.chromium.org/11186002/diff/15001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/15001/chrome/browser/net/chrome_network_delegate.cc#newcode127 chrome/browser/net/chrome_network_delegate.cc:127: if (parameter == parameter_to_find) You could do this check ...
8 years, 2 months ago (2012-10-22 09:50:18 UTC) #16
Joao da Silva
Mostly good for me! Please have a look at the suggestions to simplify the code ...
8 years, 2 months ago (2012-10-22 21:14:20 UTC) #17
Sergiu
This set has more simplifications/improvements based on your comments, please review. Sorry for the big ...
8 years, 1 month ago (2012-10-30 01:08:10 UTC) #18
Joao da Silva
lgtm! http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc#newcode107 chrome/browser/net/chrome_network_delegate.cc:107: return false; return StartsWithASCII(parameter, parameter_prefix, false); http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc#newcode135 chrome/browser/net/chrome_network_delegate.cc:135: ...
8 years, 1 month ago (2012-10-30 09:09:49 UTC) #19
Bernhard Bauer
LGTM!
8 years, 1 month ago (2012-10-30 12:17:31 UTC) #20
battre
http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc#newcode100 chrome/browser/net/chrome_network_delegate.cc:100: const std::string& parameter_to_find) { I think this function does ...
8 years, 1 month ago (2012-10-30 12:56:09 UTC) #21
Sergiu
Dominic, please check the replies to some of your comments, there are some areas where ...
8 years, 1 month ago (2012-10-30 21:58:17 UTC) #22
battre
LGTM http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/24001/chrome/browser/net/chrome_network_delegate.cc#newcode100 chrome/browser/net/chrome_network_delegate.cc:100: const std::string& parameter_to_find) { On 2012/10/30 21:58:17, Sergiu ...
8 years, 1 month ago (2012-10-31 13:16:55 UTC) #23
Pam (message me for reviews)
http://codereview.chromium.org/11186002/diff/22020/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/22020/chrome/browser/net/chrome_network_delegate.cc#newcode99 chrome/browser/net/chrome_network_delegate.cc:99: // We set the second parameter so it must ...
8 years, 1 month ago (2012-10-31 13:50:35 UTC) #24
battre
http://codereview.chromium.org/11186002/diff/22020/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/22020/chrome/browser/net/chrome_network_delegate.cc#newcode113 chrome/browser/net/chrome_network_delegate.cc:113: std::string ssui_parameter = chrome::kSafeSearchSsuiParameter; On 2012/10/31 13:50:35, Pam wrote: ...
8 years, 1 month ago (2012-10-31 14:06:08 UTC) #25
Sergiu
Adressed the last comments and also synced the tree to the latest version which led ...
8 years, 1 month ago (2012-11-01 18:01:52 UTC) #26
Bernhard Bauer
As a general tip, if the CL is big and you sync during a code ...
8 years, 1 month ago (2012-11-02 13:54:34 UTC) #27
Pam (message me for reviews)
http://codereview.chromium.org/11186002/diff/22020/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/22020/chrome/browser/net/chrome_network_delegate.cc#newcode113 chrome/browser/net/chrome_network_delegate.cc:113: std::string ssui_parameter = chrome::kSafeSearchSsuiParameter; On 2012/10/31 14:06:08, battre wrote: ...
8 years, 1 month ago (2012-11-02 14:00:35 UTC) #28
Sergiu
I thought that rebasing might break stuff up in codereview but I'm still not sure ...
8 years, 1 month ago (2012-11-02 20:38:43 UTC) #29
Bernhard Bauer
On 2012/11/02 20:38:43, Sergiu wrote: > I thought that rebasing might break stuff up in ...
8 years, 1 month ago (2012-11-02 20:56:46 UTC) #30
Peter Kasting
Drive-by: Please add a bug value to the BUG= line.
8 years, 1 month ago (2012-11-02 20:58:01 UTC) #31
Peter Kasting
http://codereview.chromium.org/11186002/diff/39004/chrome/browser/google/google_util.cc File chrome/browser/google/google_util.cc (right): http://codereview.chromium.org/11186002/diff/39004/chrome/browser/google/google_util.cc#newcode326 chrome/browser/google/google_util.cc:326: return IsGoogleSearchUrl(url) || IsGoogleHomePageUrl(url); Don't add this. Have the ...
8 years, 1 month ago (2012-11-02 20:59:11 UTC) #32
Sergiu
Got it, add a separate patch set for the merge, will do that from now ...
8 years, 1 month ago (2012-11-02 22:09:58 UTC) #33
Bernhard Bauer
LGTM!
8 years, 1 month ago (2012-11-02 22:59:12 UTC) #34
battre
lgtm
8 years, 1 month ago (2012-11-05 14:06:59 UTC) #35
Pam (message me for reviews)
LGTM.
8 years, 1 month ago (2012-11-05 14:37:39 UTC) #36
Joao da Silva
Still lgtm http://codereview.chromium.org/11186002/diff/46015/chrome/browser/net/chrome_network_delegate.cc File chrome/browser/net/chrome_network_delegate.cc (right): http://codereview.chromium.org/11186002/diff/46015/chrome/browser/net/chrome_network_delegate.cc#newcode7 chrome/browser/net/chrome_network_delegate.cc:7: #include <string> Already in .h
8 years, 1 month ago (2012-11-05 15:43:16 UTC) #37
Sergiu
On 2012/11/05 15:43:16, Joao da Silva wrote: > Still lgtm > > http://codereview.chromium.org/11186002/diff/46015/chrome/browser/net/chrome_network_delegate.cc > File ...
8 years, 1 month ago (2012-11-06 17:03:11 UTC) #38
Joao da Silva
Thanks for fixing the flakiness. lgtm after a green bot run
8 years, 1 month ago (2012-11-07 09:33:40 UTC) #39
Joao da Silva
Hopefully that's the end of the story for that test :-) Nice catch! lgtm
8 years, 1 month ago (2012-11-07 19:37:05 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11186002/49006
8 years, 1 month ago (2012-11-08 08:26:04 UTC) #41
commit-bot: I haz the power
Presubmit check for 11186002-49006 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 1 month ago (2012-11-08 08:26:12 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11186002/42012
8 years, 1 month ago (2012-11-08 09:11:06 UTC) #43
commit-bot: I haz the power
Change committed as 166656
8 years, 1 month ago (2012-11-08 11:10:36 UTC) #44
Sergiu
thakis@chromium.org:TBR for chrome/OWNERS.
8 years, 1 month ago (2012-11-08 17:19:37 UTC) #45
Nico
Why is this done at the network level? I would have expected this code in ...
8 years, 1 month ago (2012-11-08 19:06:10 UTC) #46
Bernhard Bauer
We want this to apply for all search requests, not only for the ones made ...
8 years, 1 month ago (2012-11-08 20:10:46 UTC) #47
Nico
On Thu, Nov 8, 2012 at 12:03 PM, Bernhard Bauer <bauerb@chromium.org> wrote: > We want ...
8 years, 1 month ago (2012-11-09 17:56:34 UTC) #48
Sergiu (please use other one)
Bernhard is referring to the requests that are done by typing "google.com" in the omnibox ...
8 years, 1 month ago (2012-11-09 18:00:36 UTC) #49
Bernhard Bauer
8 years, 1 month ago (2012-11-12 09:25:32 UTC) #50
http://codereview.chromium.org/11186002/diff/42012/chrome/app/policy/policy_t...
File chrome/app/policy/policy_templates.json (right):

http://codereview.chromium.org/11186002/diff/42012/chrome/app/policy/policy_t...
chrome/app/policy/policy_templates.json:571: If you disable this setting,
SafeSearch in Google Search is not enforced.''',
Post-commit comment: This should probably be "If this setting is disabled or not
set, [...]".

Powered by Google App Engine
This is Rietveld 408576698