Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: chrome/browser/policy/policy_helpers.cc

Issue 110643005: Refactored the URLBlacklistManager to avoid chrome/ and content/ dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/policy_helpers.h ('k') | chrome/browser/policy/url_blacklist_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_helpers.cc
diff --git a/chrome/browser/policy/policy_helpers.cc b/chrome/browser/policy/policy_helpers.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9f71a942c487c6e3b309643e163cdb991a4291eb
--- /dev/null
+++ b/chrome/browser/policy/policy_helpers.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/policy/policy_helpers.h"
+
+#include "url/gurl.h"
+
+#if !defined(OS_CHROMEOS)
+#include "chrome/browser/signin/signin_manager.h"
+#include "google_apis/gaia/gaia_urls.h"
+#endif
+
+namespace policy {
+
+bool SkipBlacklistForURL(const GURL& url) {
+#if defined(OS_CHROMEOS)
+ return false;
+#else
+ static const char kServiceLoginAuth[] = "/ServiceLoginAuth";
+
+ // Whitelist all the signin flow URLs flagged by the SigninManager.
+ if (SigninManager::IsWebBasedSigninFlowURL(url))
+ return true;
+
+ // Additionally whitelist /ServiceLoginAuth.
+ if (url.GetOrigin() != GaiaUrls::GetInstance()->gaia_url().GetOrigin())
+ return false;
+
+ return url.path() == kServiceLoginAuth;
+#endif
+}
+
+} // namespace policy
« no previous file with comments | « chrome/browser/policy/policy_helpers.h ('k') | chrome/browser/policy/url_blacklist_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698