Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / policy / policy_helpers.cc
blob9f71a942c487c6e3b309643e163cdb991a4291eb
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
3 // found in the LICENSE file.
5 #include "chrome/browser/policy/policy_helpers.h"
7 #include "url/gurl.h"
9 #if !defined(OS_CHROMEOS)
10 #include "chrome/browser/signin/signin_manager.h"
11 #include "google_apis/gaia/gaia_urls.h"
12 #endif
14 namespace policy {
16 bool SkipBlacklistForURL(const GURL& url) {
17 #if defined(OS_CHROMEOS)
18 return false;
19 #else
20 static const char kServiceLoginAuth[] = "/ServiceLoginAuth";
22 // Whitelist all the signin flow URLs flagged by the SigninManager.
23 if (SigninManager::IsWebBasedSigninFlowURL(url))
24 return true;
26 // Additionally whitelist /ServiceLoginAuth.
27 if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin())
28 return false;
30 return url.path() == kServiceLoginAuth;
31 #endif
34 } // namespace policy