Chromium Code Reviews| 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/policy/policy_helpers.h" | 5 #include "chrome/browser/policy/policy_helpers.h" |
| 6 | 6 |
| 7 #include "url/gurl.h" | 7 #include "url/gurl.h" |
| 8 | 8 |
| 9 #if !defined(OS_CHROMEOS) && !defined(OS_IOS) | 9 #if !defined(OS_CHROMEOS) && !defined(OS_IOS) |
| 10 #include "chrome/browser/signin/signin_manager.h" | 10 #include "chrome/browser/signin/signin_manager.h" |
| 11 #include "google_apis/gaia/gaia_urls.h" | 11 #include "google_apis/gaia/gaia_urls.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 namespace policy { | 14 namespace policy { |
| 15 | 15 |
| 16 bool OverrideBlacklistForURL(const GURL& url, bool* block) { | 16 bool OverrideBlacklistForURL(bool is_oobe_done, const GURL& url, bool* block) { |
| 17 #if defined(OS_CHROMEOS) || defined(OS_IOS) | 17 #if defined(OS_CHROMEOS) |
| 18 // On ChromeOS browsing is only allowed once OOBE has completed. Therefore all | |
| 19 // requests are blocked until this condition is met. | |
| 20 if (!is_oobe_done) { | |
| 21 if (url.SchemeIsHTTPOrHTTPS()) { | |
|
Mattias Nissler (ping if slow)
2014/03/25 08:31:32
So FTP is still allowed? might just want to whitel
| |
| 22 *block = true; | |
| 23 return true; | |
| 24 } | |
| 25 } | |
| 26 return false; | |
| 27 #elif defined(OS_IOS) | |
| 18 return false; | 28 return false; |
| 19 #else | 29 #else |
| 20 static const char kServiceLoginAuth[] = "/ServiceLoginAuth"; | 30 static const char kServiceLoginAuth[] = "/ServiceLoginAuth"; |
| 21 | 31 |
| 22 *block = false; | 32 *block = false; |
| 23 // Whitelist all the signin flow URLs flagged by the SigninManager. | 33 // Whitelist all the signin flow URLs flagged by the SigninManager. |
| 24 if (SigninManager::IsWebBasedSigninFlowURL(url)) | 34 if (SigninManager::IsWebBasedSigninFlowURL(url)) |
| 25 return true; | 35 return true; |
| 26 | 36 |
| 27 // Additionally whitelist /ServiceLoginAuth. | 37 // Additionally whitelist /ServiceLoginAuth. |
| 28 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin()) | 38 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin()) |
| 29 return false; | 39 return false; |
| 30 | 40 |
| 31 return url.path() == kServiceLoginAuth; | 41 return url.path() == kServiceLoginAuth; |
| 32 #endif | 42 #endif |
| 33 } | 43 } |
| 34 | 44 |
| 35 } // namespace policy | 45 } // namespace policy |
| OLD | NEW |