| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_frame/navigation_constraints.h" | 5 #include "chrome_frame/navigation_constraints.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "chrome_frame/utils.h" | 10 #include "chrome_frame/utils.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 if (!security_manager_) { | 59 if (!security_manager_) { |
| 60 HRESULT hr = security_manager_.CreateInstance( | 60 HRESULT hr = security_manager_.CreateInstance( |
| 61 CLSID_InternetSecurityManager); | 61 CLSID_InternetSecurityManager); |
| 62 if (FAILED(hr)) { | 62 if (FAILED(hr)) { |
| 63 NOTREACHED() << __FUNCTION__ | 63 NOTREACHED() << __FUNCTION__ |
| 64 << " Failed to create SecurityManager. Error: 0x%x" | 64 << " Failed to create SecurityManager. Error: 0x%x" |
| 65 << hr; | 65 << hr; |
| 66 return true; | 66 return true; |
| 67 } | 67 } |
| 68 DWORD zone = URLZONE_INVALID; | 68 DWORD zone = URLZONE_INVALID; |
| 69 std::wstring unicode_url = UTF8ToWide(url.spec()); | 69 std::wstring unicode_url = base::UTF8ToWide(url.spec()); |
| 70 security_manager_->MapUrlToZone(unicode_url.c_str(), &zone, 0); | 70 security_manager_->MapUrlToZone(unicode_url.c_str(), &zone, 0); |
| 71 if (zone == URLZONE_UNTRUSTED) { | 71 if (zone == URLZONE_UNTRUSTED) { |
| 72 DLOG(WARNING) << __FUNCTION__ | 72 DLOG(WARNING) << __FUNCTION__ |
| 73 << " Disallowing navigation to restricted url: " << url; | 73 << " Disallowing navigation to restricted url: " << url; |
| 74 return false; | 74 return false; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 return true; | 77 return true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool NavigationConstraintsImpl::is_privileged() const { | 80 bool NavigationConstraintsImpl::is_privileged() const { |
| 81 return is_privileged_; | 81 return is_privileged_; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void NavigationConstraintsImpl::set_is_privileged(bool is_privileged) { | 84 void NavigationConstraintsImpl::set_is_privileged(bool is_privileged) { |
| 85 is_privileged_ = is_privileged; | 85 is_privileged_ = is_privileged; |
| 86 } | 86 } |
| OLD | NEW |