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

Unified Diff: chrome/browser/supervised_user/supervised_user_navigation_throttle.cc

Issue 2795993002: SupervisedUserNavigationThrottle: create only for supervised profiles (Closed)
Patch Set: simplify Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/supervised_user/supervised_user_navigation_throttle.cc
diff --git a/chrome/browser/supervised_user/supervised_user_navigation_throttle.cc b/chrome/browser/supervised_user/supervised_user_navigation_throttle.cc
index ec74ae4619168776036806ad3ac4fee5cc00944f..852b412ba3d1a804229b72bbb938a00bf99e0e36 100644
--- a/chrome/browser/supervised_user/supervised_user_navigation_throttle.cc
+++ b/chrome/browser/supervised_user/supervised_user_navigation_throttle.cc
@@ -120,7 +120,9 @@ void RecordFilterResultEvent(
std::unique_ptr<SupervisedUserNavigationThrottle>
SupervisedUserNavigationThrottle::MaybeCreateThrottleFor(
content::NavigationHandle* navigation_handle) {
- if (!navigation_handle->IsInMainFrame())
+ Profile* profile = Profile::FromBrowserContext(
+ navigation_handle->GetWebContents()->GetBrowserContext());
+ if (!profile->IsSupervised() || !navigation_handle->IsInMainFrame())
Bernhard Bauer 2017/04/05 09:31:12 I would split these up into two separate checks.
Marc Treib 2017/04/05 11:43:33 Done.
return nullptr;
// Can't use base::MakeUnique because the constructor is private.
return base::WrapUnique(

Powered by Google App Engine
This is Rietveld 408576698