| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/search/search.h" | 5 #include "chrome/browser/search/search.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 if (!instant_url.is_valid()) | 155 if (!instant_url.is_valid()) |
| 156 return false; | 156 return false; |
| 157 | 157 |
| 158 return MatchesOriginAndPath(url, instant_url); | 158 return MatchesOriginAndPath(url, instant_url); |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) { | 161 bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) { |
| 162 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 162 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 163 SupervisedUserService* supervised_user_service = | 163 SupervisedUserService* supervised_user_service = |
| 164 SupervisedUserServiceFactory::GetForProfile(profile); | 164 SupervisedUserServiceFactory::GetForProfile(profile); |
| 165 SupervisedUserURLFilter* url_filter = | 165 SupervisedUserURLFilter* url_filter = supervised_user_service->GetURLFilter(); |
| 166 supervised_user_service->GetURLFilterForUIThread(); | |
| 167 if (url_filter->GetFilteringBehaviorForURL(url) == | 166 if (url_filter->GetFilteringBehaviorForURL(url) == |
| 168 SupervisedUserURLFilter::BLOCK) { | 167 SupervisedUserURLFilter::BLOCK) { |
| 169 return false; | 168 return false; |
| 170 } | 169 } |
| 171 #endif | 170 #endif |
| 172 return true; | 171 return true; |
| 173 } | 172 } |
| 174 | 173 |
| 175 // Returns whether |new_tab_url| can be used as a URL for the New Tab page. | 174 // Returns whether |new_tab_url| can be used as a URL for the New Tab page. |
| 176 // NEW_TAB_URL_VALID means a valid URL; other enum values imply an invalid URL. | 175 // NEW_TAB_URL_VALID means a valid URL; other enum values imply an invalid URL. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 | 458 |
| 460 if (IsInstantNTPURL(*url, profile)) { | 459 if (IsInstantNTPURL(*url, profile)) { |
| 461 *url = GURL(chrome::kChromeUINewTabURL); | 460 *url = GURL(chrome::kChromeUINewTabURL); |
| 462 return true; | 461 return true; |
| 463 } | 462 } |
| 464 | 463 |
| 465 return false; | 464 return false; |
| 466 } | 465 } |
| 467 | 466 |
| 468 } // namespace search | 467 } // namespace search |
| OLD | NEW |