| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/ntp/most_visited_sites_bridge.h" | 5 #include "chrome/browser/android/ntp/most_visited_sites_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 DCHECK(!supervisor_observer_); | 57 DCHECK(!supervisor_observer_); |
| 58 else | 58 else |
| 59 DCHECK(supervisor_observer_); | 59 DCHECK(supervisor_observer_); |
| 60 | 60 |
| 61 supervisor_observer_ = new_observer; | 61 supervisor_observer_ = new_observer; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool MostVisitedSitesBridge::SupervisorBridge::IsBlocked(const GURL& url) { | 64 bool MostVisitedSitesBridge::SupervisorBridge::IsBlocked(const GURL& url) { |
| 65 SupervisedUserService* supervised_user_service = | 65 SupervisedUserService* supervised_user_service = |
| 66 SupervisedUserServiceFactory::GetForProfile(profile_); | 66 SupervisedUserServiceFactory::GetForProfile(profile_); |
| 67 auto url_filter = supervised_user_service->GetURLFilterForUIThread(); | 67 auto* url_filter = supervised_user_service->GetURLFilterForUIThread(); |
| 68 return url_filter->GetFilteringBehaviorForURL(url) == | 68 return url_filter->GetFilteringBehaviorForURL(url) == |
| 69 SupervisedUserURLFilter::FilteringBehavior::BLOCK; | 69 SupervisedUserURLFilter::FilteringBehavior::BLOCK; |
| 70 } | 70 } |
| 71 | 71 |
| 72 std::vector<MostVisitedSitesSupervisor::Whitelist> | 72 std::vector<MostVisitedSitesSupervisor::Whitelist> |
| 73 MostVisitedSitesBridge::SupervisorBridge::whitelists() { | 73 MostVisitedSitesBridge::SupervisorBridge::whitelists() { |
| 74 std::vector<MostVisitedSitesSupervisor::Whitelist> results; | 74 std::vector<MostVisitedSitesSupervisor::Whitelist> results; |
| 75 SupervisedUserService* supervised_user_service = | 75 SupervisedUserService* supervised_user_service = |
| 76 SupervisedUserServiceFactory::GetForProfile(profile_); | 76 SupervisedUserServiceFactory::GetForProfile(profile_); |
| 77 for (const auto& whitelist : supervised_user_service->whitelists()) { | 77 for (const auto& whitelist : supervised_user_service->whitelists()) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 | 226 |
| 227 static jlong Init(JNIEnv* env, | 227 static jlong Init(JNIEnv* env, |
| 228 const JavaParamRef<jobject>& obj, | 228 const JavaParamRef<jobject>& obj, |
| 229 const JavaParamRef<jobject>& jprofile) { | 229 const JavaParamRef<jobject>& jprofile) { |
| 230 MostVisitedSitesBridge* most_visited_sites = | 230 MostVisitedSitesBridge* most_visited_sites = |
| 231 new MostVisitedSitesBridge( | 231 new MostVisitedSitesBridge( |
| 232 ProfileAndroid::FromProfileAndroid(jprofile)); | 232 ProfileAndroid::FromProfileAndroid(jprofile)); |
| 233 return reinterpret_cast<intptr_t>(most_visited_sites); | 233 return reinterpret_cast<intptr_t>(most_visited_sites); |
| 234 } | 234 } |
| OLD | NEW |