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) | 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 SkipBlacklistForURL(const GURL& url) { | 16 bool SkipBlacklistForURL(const GURL& url) { |
17 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) || defined(OS_IOS) |
18 return false; | 18 return false; |
19 #else | 19 #else |
20 static const char kServiceLoginAuth[] = "/ServiceLoginAuth"; | 20 static const char kServiceLoginAuth[] = "/ServiceLoginAuth"; |
21 | 21 |
22 // Whitelist all the signin flow URLs flagged by the SigninManager. | 22 // Whitelist all the signin flow URLs flagged by the SigninManager. |
23 if (SigninManager::IsWebBasedSigninFlowURL(url)) | 23 if (SigninManager::IsWebBasedSigninFlowURL(url)) |
24 return true; | 24 return true; |
25 | 25 |
26 // Additionally whitelist /ServiceLoginAuth. | 26 // Additionally whitelist /ServiceLoginAuth. |
27 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin()) | 27 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin()) |
28 return false; | 28 return false; |
29 | 29 |
30 return url.path() == kServiceLoginAuth; | 30 return url.path() == kServiceLoginAuth; |
31 #endif | 31 #endif |
32 } | 32 } |
33 | 33 |
34 } // namespace policy | 34 } // namespace policy |
OLD | NEW |