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

Unified Diff: chrome_frame/navigation_constraints.cc

Issue 126143005: Remove Chrome Frame code and resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to r244038 Created 6 years, 11 months 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_frame/navigation_constraints.h ('k') | chrome_frame/npchrome_frame_dll.ver » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/navigation_constraints.cc
diff --git a/chrome_frame/navigation_constraints.cc b/chrome_frame/navigation_constraints.cc
deleted file mode 100644
index ddb21e37f380a69a3df1e4635a0a880373f628a3..0000000000000000000000000000000000000000
--- a/chrome_frame/navigation_constraints.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2010 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_frame/navigation_constraints.h"
-
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/common/url_constants.h"
-#include "chrome_frame/utils.h"
-#include "extensions/common/constants.h"
-
-NavigationConstraintsImpl::NavigationConstraintsImpl() : is_privileged_(false) {
-}
-
-// NavigationConstraintsImpl method definitions.
-bool NavigationConstraintsImpl::AllowUnsafeUrls() {
- // No sanity checks if unsafe URLs are allowed
- return GetConfigBool(false, kAllowUnsafeURLs);
-}
-
-bool NavigationConstraintsImpl::IsSchemeAllowed(const GURL& url) {
- if (url.is_empty())
- return false;
-
- if (!url.is_valid())
- return false;
-
- if (url.SchemeIs(content::kHttpScheme) || url.SchemeIs(content::kHttpsScheme))
- return true;
-
- // Additional checking for view-source. Allow only http and https
- // URLs in view source.
- if (url.SchemeIs(content::kViewSourceScheme)) {
- GURL sub_url(url.GetContent());
- if (sub_url.SchemeIs(content::kHttpScheme) ||
- sub_url.SchemeIs(content::kHttpsScheme))
- return true;
- }
-
- // Allow only about:blank or about:version
- if (url.SchemeIs(chrome::kAboutScheme)) {
- if (LowerCaseEqualsASCII(url.spec(), content::kAboutBlankURL) ||
- LowerCaseEqualsASCII(url.spec(), chrome::kAboutVersionURL)) {
- return true;
- }
- }
-
- if (is_privileged_ &&
- (url.SchemeIs(chrome::kDataScheme) ||
- url.SchemeIs(extensions::kExtensionScheme))) {
- return true;
- }
-
- return false;
-}
-
-bool NavigationConstraintsImpl::IsZoneAllowed(const GURL& url) {
- if (!security_manager_) {
- HRESULT hr = security_manager_.CreateInstance(
- CLSID_InternetSecurityManager);
- if (FAILED(hr)) {
- NOTREACHED() << __FUNCTION__
- << " Failed to create SecurityManager. Error: 0x%x"
- << hr;
- return true;
- }
- DWORD zone = URLZONE_INVALID;
- std::wstring unicode_url = base::UTF8ToWide(url.spec());
- security_manager_->MapUrlToZone(unicode_url.c_str(), &zone, 0);
- if (zone == URLZONE_UNTRUSTED) {
- DLOG(WARNING) << __FUNCTION__
- << " Disallowing navigation to restricted url: " << url;
- return false;
- }
- }
- return true;
-}
-
-bool NavigationConstraintsImpl::is_privileged() const {
- return is_privileged_;
-}
-
-void NavigationConstraintsImpl::set_is_privileged(bool is_privileged) {
- is_privileged_ = is_privileged;
-}
« no previous file with comments | « chrome_frame/navigation_constraints.h ('k') | chrome_frame/npchrome_frame_dll.ver » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698