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

Issue 11299035: Support manual (white|black)list, previewing and allowing after interstitial (Closed)

Created:
8 years, 1 month ago by Sergiu
Modified:
7 years, 11 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Adds support for manual whitelist and blacklist, previewing a page and adding it to the whitelist for managed users. This CL adds two user preferences (kManagedModeWhitelist and kManagedModeBlacklist) which contain URL patterns which should be allowed or blocked. The user preferences are used only to persistently store the lists and the checking is done by the ManagedModeURLFilter, which uses policy::URLBlacklist objects. The code takes care that the preferences and the URLFilter are kept in sync all the time. It also contains the functions needed to interact with these lists (adding, removing or checking). It also adds a preview infobar which pops up when the user clicks Preview on the interstitial. If the user clicks allow then the website is added to the whitelist. The domain gets added plus all redirects that lead to that page. The user is able to click navigate around the website without getting another interstitial as long as he does not navigate to a different host name. BUG=168772 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175806

Patch Set 1 #

Total comments: 51

Patch Set 2 : Refactored and improved the code. #

Patch Set 3 : Rebase #

Patch Set 4 : Allow/block flow which includes preview mode. #

Total comments: 79

Patch Set 5 : Changes according to comments. #

Total comments: 38

Patch Set 6 : Changes in response to comments. #

Total comments: 10

Patch Set 7 : Split navigated_urls in two and refactor. #

Total comments: 24

Patch Set 8 : Moved back to GURLs instead of patterns, minor edits. #

Total comments: 2

Patch Set 9 : DCHECKs and minor change. #

Total comments: 2

Patch Set 10 : Moving ifs to switch. #

Total comments: 2

Patch Set 11 : Removing default in switch. #

Total comments: 27

Patch Set 12 : Updated code from integration package + replies to comments. #

Patch Set 13 : Fix bad text in generated_resources.grd and rebase to ToT #

Total comments: 35

Patch Set 14 : Replying to comments. #

Total comments: 7

Patch Set 15 : Minor fixes. #

Total comments: 2

Patch Set 16 : Last nits #

Total comments: 2

Patch Set 17 : Rebase, update infobars to use Create() and minor nit. #

Patch Set 18 : Update a function in navigation_observer. #

Total comments: 2

Patch Set 19 : Initialize the white/blacklist properly + nit #

Patch Set 20 : Initialize manual whitelist to block everything in the begining. #

Total comments: 9

Patch Set 21 : Minor changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+747 lines, -25 lines) Patch
M chrome/app/generated_resources.grd View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +55 lines, -1 line 0 comments Download
M chrome/browser/managed_mode/managed_mode.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +120 lines, -2 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_interstitial.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_navigation_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +81 lines, -0 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_navigation_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 chunks +313 lines, -11 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_resource_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +18 lines, -2 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_resource_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +65 lines, -8 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_url_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +19 lines, -0 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_url_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +55 lines, -1 line 0 comments Download
M chrome/common/pref_names.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (0 generated)
Sergiu
Here is the patch on Rietveld, it's against a pretty old branch on Bernhard's tree ...
8 years, 1 month ago (2012-11-16 13:38:52 UTC) #1
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/1/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/11299035/diff/1/chrome/app/generated_resources.grd#newcode15132 chrome/app/generated_resources.grd:15132: + Add to whitelist! So many exclamation marks! I ...
8 years, 1 month ago (2012-11-16 15:04:46 UTC) #2
Sergiu
I've replied to the comments but I needed to make a lot of changes in ...
8 years ago (2012-11-26 14:48:08 UTC) #3
Bernhard Bauer
It's not actually as bad as it looks like with the 39 comments ;-) I ...
8 years ago (2012-11-26 16:06:30 UTC) #4
Sergiu
Uploaded a new patch set, feedback is welcome as always. Sergiu https://codereview.chromium.org/11299035/diff/12010/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): ...
8 years ago (2012-11-27 15:37:34 UTC) #5
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/12010/chrome/browser/managed_mode/managed_mode.h File chrome/browser/managed_mode/managed_mode.h (right): https://codereview.chromium.org/11299035/diff/12010/chrome/browser/managed_mode/managed_mode.h#newcode86 chrome/browser/managed_mode/managed_mode.h:86: static scoped_ptr<base::ListValue> GetBlacklist(); On 2012/11/27 15:37:34, Sergiu wrote: > ...
8 years ago (2012-11-27 18:44:45 UTC) #6
Sergiu
Taking another go at it :) Sergiu https://codereview.chromium.org/11299035/diff/4015/chrome/browser/managed_mode/managed_mode.cc File chrome/browser/managed_mode/managed_mode.cc (right): https://codereview.chromium.org/11299035/diff/4015/chrome/browser/managed_mode/managed_mode.cc#newcode267 chrome/browser/managed_mode/managed_mode.cc:267: // static ...
8 years ago (2012-11-28 12:53:25 UTC) #7
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/4015/chrome/browser/managed_mode/managed_mode.h File chrome/browser/managed_mode/managed_mode.h (right): https://codereview.chromium.org/11299035/diff/4015/chrome/browser/managed_mode/managed_mode.h#newcode76 chrome/browser/managed_mode/managed_mode.h:76: bool IsInManualWhitelistImpl(const std::string& url_pattern); On 2012/11/28 12:53:25, Sergiu wrote: ...
8 years ago (2012-11-28 14:21:05 UTC) #8
Sergiu
As discussed I have split navigated_urls_ in two, a list of url patterns and a ...
8 years ago (2012-11-29 12:00:17 UTC) #9
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode.cc File chrome/browser/managed_mode/managed_mode.cc (right): https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode.cc#newcode278 chrome/browser/managed_mode/managed_mode.cc:278: pref_whitelist->AppendIfNotPresent(new StringValue(url_pattern)); Wait, why do we need this if ...
8 years ago (2012-12-03 10:23:37 UTC) #10
Sergiu
Changed urls_patterns to set<GURL> and renamed them because of that, should be cleaner now. https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode.cc ...
8 years ago (2012-12-04 14:02:31 UTC) #11
Bernhard Bauer
We're converging! :) https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode431 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:431: behavior == ManagedModeURLFilter::BLOCK) { On 2012/12/04 ...
8 years ago (2012-12-04 14:25:00 UTC) #12
Sergiu
https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/2004/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode431 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:431: behavior == ManagedModeURLFilter::BLOCK) { On 2012/12/04 14:25:00, Bernhard Bauer ...
8 years ago (2012-12-04 15:45:46 UTC) #13
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/5019/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/5019/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode441 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:441: behavior == ManagedModeURLFilter::BLOCK) { Can you restructure this into ...
8 years ago (2012-12-04 15:50:31 UTC) #14
Sergiu
Hopefully it's ok now. :) https://codereview.chromium.org/11299035/diff/5019/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/5019/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode441 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:441: behavior == ManagedModeURLFilter::BLOCK) { ...
8 years ago (2012-12-04 16:25:24 UTC) #15
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/10017/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/10017/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode456 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:456: default: This is not necessary; the compiler will check ...
8 years ago (2012-12-04 16:27:25 UTC) #16
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/10017/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/10017/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode456 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:456: default: On 2012/12/04 16:27:25, Bernhard Bauer wrote: > This ...
8 years ago (2012-12-04 17:13:39 UTC) #17
Pam (message me for reviews)
https://codereview.chromium.org/11299035/diff/19001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/11299035/diff/19001/chrome/app/generated_resources.grd#newcode15337 chrome/app/generated_resources.grd:15337: + This URL was already on the whitelist so ...
8 years ago (2012-12-06 15:11:56 UTC) #18
Sergiu
I've uploaded a new version pulled out from our latest patch. This was applied on ...
7 years, 11 months ago (2013-01-04 15:44:07 UTC) #19
Bernhard Bauer
https://codereview.chromium.org/11299035/diff/19001/chrome/browser/managed_mode/managed_mode.h File chrome/browser/managed_mode/managed_mode.h (right): https://codereview.chromium.org/11299035/diff/19001/chrome/browser/managed_mode/managed_mode.h#newcode162 chrome/browser/managed_mode/managed_mode.h:162: // Returns a copy of the manual whitelist which ...
7 years, 11 months ago (2013-01-07 12:34:19 UTC) #20
Pam (message me for reviews)
https://codereview.chromium.org/11299035/diff/35001/chrome/browser/managed_mode/managed_mode.h File chrome/browser/managed_mode/managed_mode.h (right): https://codereview.chromium.org/11299035/diff/35001/chrome/browser/managed_mode/managed_mode.h#newcode76 chrome/browser/managed_mode/managed_mode.h:76: static bool IsInManualList(const bool isWhitelist, Style nit: is_whitelist (also ...
7 years, 11 months ago (2013-01-07 13:00:16 UTC) #21
Sergiu
Hopefully getting closer :) https://codereview.chromium.org/11299035/diff/35001/chrome/browser/managed_mode/managed_mode.cc File chrome/browser/managed_mode/managed_mode.cc (right): https://codereview.chromium.org/11299035/diff/35001/chrome/browser/managed_mode/managed_mode.cc#newcode68 chrome/browser/managed_mode/managed_mode.cc:68: void LoadManualLists(scoped_ptr<ListValue> whitelist, On 2013/01/07 ...
7 years, 11 months ago (2013-01-07 16:25:05 UTC) #22
Bernhard Bauer
Getting there ;-) I found an additional nit I hadn't noticed before, sorry. https://codereview.chromium.org/11299035/diff/49001/chrome/browser/managed_mode/managed_mode.cc File ...
7 years, 11 months ago (2013-01-07 17:31:49 UTC) #23
Pam (message me for reviews)
LGTM with nits (mine and Bernhard's) squashed. - Pam https://codereview.chromium.org/11299035/diff/49001/chrome/browser/managed_mode/managed_mode.h File chrome/browser/managed_mode/managed_mode.h (right): https://codereview.chromium.org/11299035/diff/49001/chrome/browser/managed_mode/managed_mode.h#newcode74 chrome/browser/managed_mode/managed_mode.h:74: ...
7 years, 11 months ago (2013-01-08 09:15:52 UTC) #24
Pam (message me for reviews)
https://codereview.chromium.org/11299035/diff/46002/chrome/common/pref_names.h File chrome/common/pref_names.h (right): https://codereview.chromium.org/11299035/diff/46002/chrome/common/pref_names.h#newcode23 chrome/common/pref_names.h:23: extern const char kInManagedMode[]; Hang on -- unless Bernhard's ...
7 years, 11 months ago (2013-01-08 09:17:17 UTC) #25
Sergiu
https://codereview.chromium.org/11299035/diff/49001/chrome/browser/managed_mode/managed_mode.cc File chrome/browser/managed_mode/managed_mode.cc (right): https://codereview.chromium.org/11299035/diff/49001/chrome/browser/managed_mode/managed_mode.cc#newcode78 chrome/browser/managed_mode/managed_mode.cc:78: void AddURLPatternToManualList(const bool is_whitelist, On 2013/01/07 17:31:49, Bernhard Bauer ...
7 years, 11 months ago (2013-01-08 09:31:54 UTC) #26
Pam (message me for reviews)
LGTM. - Pam
7 years, 11 months ago (2013-01-08 09:43:29 UTC) #27
Bernhard Bauer
LGTM with one nit below. Also, description nit: You should add a reference to "managed ...
7 years, 11 months ago (2013-01-08 12:15:30 UTC) #28
Sergiu
Commiting now. https://codereview.chromium.org/11299035/diff/49015/chrome/common/pref_names.h File chrome/common/pref_names.h (right): https://codereview.chromium.org/11299035/diff/49015/chrome/common/pref_names.h#newcode811 chrome/common/pref_names.h:811: extern const char kInManagedMode[]; On 2013/01/08 12:15:30, ...
7 years, 11 months ago (2013-01-08 13:05:11 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/46004
7 years, 11 months ago (2013-01-08 13:05:42 UTC) #30
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 11 months ago (2013-01-08 13:31:56 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/49016
7 years, 11 months ago (2013-01-08 13:46:13 UTC) #32
Bernhard Bauer
Found another nit, sorry ;-) https://codereview.chromium.org/11299035/diff/49016/chrome/browser/managed_mode/managed_mode_url_filter.cc File chrome/browser/managed_mode/managed_mode_url_filter.cc (right): https://codereview.chromium.org/11299035/diff/49016/chrome/browser/managed_mode/managed_mode_url_filter.cc#newcode290 chrome/browser/managed_mode/managed_mode_url_filter.cc:290: for (ListValue::iterator it = ...
7 years, 11 months ago (2013-01-08 13:50:10 UTC) #33
Bernhard Bauer
On 2013/01/08 13:50:10, Bernhard Bauer wrote: > Found another nit, sorry ;-) > > https://codereview.chromium.org/11299035/diff/49016/chrome/browser/managed_mode/managed_mode_url_filter.cc ...
7 years, 11 months ago (2013-01-08 13:50:40 UTC) #34
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) unit_tests
7 years, 11 months ago (2013-01-08 14:40:30 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/59001
7 years, 11 months ago (2013-01-09 08:59:54 UTC) #36
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) unit_tests
7 years, 11 months ago (2013-01-09 09:53:53 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/67002
7 years, 11 months ago (2013-01-09 10:07:42 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/67002
7 years, 11 months ago (2013-01-09 10:36:07 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/67002
7 years, 11 months ago (2013-01-09 11:05:13 UTC) #40
Sergiu
This keeps failing for some tests that seem unrelated, can you look at my latest ...
7 years, 11 months ago (2013-01-09 11:51:24 UTC) #41
Pam (message me for reviews)
If the tests don't seem related, and it's not even consistently the same test that ...
7 years, 11 months ago (2013-01-09 12:00:41 UTC) #42
Bernhard Bauer
On 2013/01/09 11:51:24, Sergiu wrote: > This keeps failing for some tests that seem unrelated, ...
7 years, 11 months ago (2013-01-09 12:01:36 UTC) #43
commit-bot: I haz the power
Retried try job too often on win_aura for step(s) content_browsertests
7 years, 11 months ago (2013-01-09 12:58:14 UTC) #44
Sergiu
Done, retrying to commit https://codereview.chromium.org/11299035/diff/67002/chrome/browser/managed_mode/managed_mode_navigation_observer.cc File chrome/browser/managed_mode/managed_mode_navigation_observer.cc (right): https://codereview.chromium.org/11299035/diff/67002/chrome/browser/managed_mode/managed_mode_navigation_observer.cc#newcode95 chrome/browser/managed_mode/managed_mode_navigation_observer.cc:95: last_allowed_page))); On 2013/01/09 12:00:41, Pam ...
7 years, 11 months ago (2013-01-09 13:04:23 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sergiu@chromium.org/11299035/64004
7 years, 11 months ago (2013-01-09 13:06:10 UTC) #46
Pam (message me for reviews)
It's hitting that NOTIMPLEMENTED in desktop_root_window_host_win.cc pretty consistently, actually. I'll see if I can reproduce ...
7 years, 11 months ago (2013-01-09 13:25:23 UTC) #47
commit-bot: I haz the power
7 years, 11 months ago (2013-01-09 15:56:06 UTC) #48
Message was sent while issue was closed.
Change committed as 175806

Powered by Google App Engine
This is Rietveld 408576698