diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 21:00:23 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 21:00:23 +0000 |
commit | e24b70c4852ca81ac9719942d82bc753256904d7 (patch) | |
tree | e2bff96244c560ba95bf0ef86e9bde71f7a5841f /chrome/browser/ssl/ssl_policy.cc | |
parent | ef77dc138e27f5f143589a4c27ca760e0ac2d079 (diff) | |
download | chromium_src-e24b70c4852ca81ac9719942d82bc753256904d7.zip chromium_src-e24b70c4852ca81ac9719942d82bc753256904d7.tar.gz chromium_src-e24b70c4852ca81ac9719942d82bc753256904d7.tar.bz2 |
Reapply of Tony's r9656 (Add chrome/browser/ssl/ssl_manager.cc to the build.)
Also port 2 more files in browser/ssl to posix
* ssl_policy
* ssl_blocking_page
Review URL: http://codereview.chromium.org/21297
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_policy.cc')
-rw-r--r-- | chrome/browser/ssl/ssl_policy.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc index 19b4575..5005ec4 100644 --- a/chrome/browser/ssl/ssl_policy.cc +++ b/chrome/browser/ssl/ssl_policy.cc @@ -11,7 +11,6 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/ssl/ssl_error_info.h" #include "chrome/browser/tab_contents/navigation_entry.h" -#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/l10n_util.h" @@ -30,6 +29,13 @@ // Generated by GRIT #include "browser_resources.h" +#if defined(OS_WIN) +// TODO(port): port these files. +#include "chrome/browser/tab_contents/tab_contents.h" +#elif defined(OS_POSIX) +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + // Wrap all these helper classes in an anonymous namespace. namespace { @@ -53,8 +59,8 @@ class ShowUnsafeContentTask : public Task { ShowUnsafeContentTask::ShowUnsafeContentTask( const GURL& main_frame_url, SSLManager::ErrorHandler* error_handler) - : main_frame_url_(main_frame_url), - error_handler_(error_handler) { + : error_handler_(error_handler), + main_frame_url_(main_frame_url) { } ShowUnsafeContentTask::~ShowUnsafeContentTask() { @@ -111,11 +117,13 @@ static void ShowBlockingPage(SSLPolicy* policy, SSLManager::CertError* error) { blocking_page->Show(); } +#if 0 +// See TODO(jcampan) below. static bool IsIntranetHost(const std::string& host) { const size_t dot = host.find(kDot); - return dot == std::basic_string<CHAR>::npos || - dot == host.length() - 1; + return dot == std::string::npos || dot == host.length() - 1; } +#endif class CommonNameInvalidPolicy : public SSLPolicy { public: @@ -242,7 +250,7 @@ class DefaultPolicy : public SSLPolicy { void OnCertError(const GURL& main_frame_url, SSLManager::CertError* error) { - int index = SubPolicyIndex(error->cert_error()); + size_t index = SubPolicyIndex(error->cert_error()); if (index < 0 || index >= arraysize(sub_policies_)) { NOTREACHED(); error->CancelRequest(); @@ -321,7 +329,7 @@ class DefaultPolicy : public SSLPolicy { } void OnDenyCertificate(SSLManager::CertError* error) { - int index = SubPolicyIndex(error->cert_error()); + size_t index = SubPolicyIndex(error->cert_error()); if (index < 0 || index >= arraysize(sub_policies_)) { NOTREACHED(); return; @@ -330,7 +338,7 @@ class DefaultPolicy : public SSLPolicy { } void OnAllowCertificate(SSLManager::CertError* error) { - int index = SubPolicyIndex(error->cert_error()); + size_t index = SubPolicyIndex(error->cert_error()); if (index < 0 || index >= arraysize(sub_policies_)) { NOTREACHED(); return; |