summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 21:00:23 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 21:00:23 +0000
commite24b70c4852ca81ac9719942d82bc753256904d7 (patch)
treee2bff96244c560ba95bf0ef86e9bde71f7a5841f /chrome/browser/ssl
parentef77dc138e27f5f143589a4c27ca760e0ac2d079 (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc4
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.h8
-rw-r--r--chrome/browser/ssl/ssl_manager.cc29
-rw-r--r--chrome/browser/ssl/ssl_policy.cc24
4 files changed, 44 insertions, 21 deletions
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index 6833e3a..c2569fe 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -72,6 +72,7 @@ std::string SSLBlockingPage::GetHTMLContents() {
}
void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) {
+#if defined(OS_WIN)
DCHECK(tab()->type() == TAB_CONTENTS_WEB);
WebContents* web = tab()->AsWebContents();
const net::SSLInfo& ssl_info = error_->ssl_info();
@@ -86,6 +87,9 @@ void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) {
NotificationType::SSL_STATE_CHANGED,
Source<NavigationController>(web->controller()),
NotificationService::NoDetails());
+#else
+ NOTIMPLEMENTED();
+#endif
}
void SSLBlockingPage::CommandReceived(const std::string& command) {
diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h
index 5ea0658..cb76e41 100644
--- a/chrome/browser/ssl/ssl_blocking_page.h
+++ b/chrome/browser/ssl/ssl_blocking_page.h
@@ -7,9 +7,13 @@
#include <string>
-#include "chrome/browser/tab_contents/interstitial_page.h"
#include "chrome/browser/ssl/ssl_manager.h"
-#include "chrome/views/decision.h"
+
+#if defined(OS_WIN)
+#include "chrome/browser/tab_contents/interstitial_page.h"
+#elif defined(OS_POSIX)
+#include "chrome/common/temp_scaffolding_stubs.h"
+#endif
class DictionaryValue;
diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc
index 60bae45..910d43f 100644
--- a/chrome/browser/ssl/ssl_manager.cc
+++ b/chrome/browser/ssl/ssl_manager.cc
@@ -8,32 +8,39 @@
#include "base/string_util.h"
#include "grit/theme_resources.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/load_notification_details.h"
#include "chrome/browser/load_from_memory_cache_details.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/resource_request_details.h"
#include "chrome/browser/ssl/ssl_error_info.h"
-#include "chrome/browser/ssl/ssl_policy.h"
-#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/provisional_load_details.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tab_contents/web_contents.h"
+#include "chrome/browser/ssl/ssl_policy.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
-#include "chrome/views/decision.h"
-#include "chrome/views/link.h"
#include "net/base/cert_status_flags.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request.h"
#include "webkit/glue/resource_type.h"
#include "generated_resources.h"
+#if defined(OS_WIN)
+// TODO(port): Port these files.
+#include "chrome/browser/load_notification_details.h"
+#include "chrome/browser/tab_contents/infobar_delegate.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/views/decision.h"
+#include "chrome/views/link.h"
+#else
+#include "chrome/common/temp_scaffolding_stubs.h"
+#endif
+
+
class SSLInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
SSLInfoBarDelegate(TabContents* contents,
@@ -93,8 +100,8 @@ void SSLManager::RegisterUserPrefs(PrefService* prefs) {
}
SSLManager::SSLManager(NavigationController* controller, Delegate* delegate)
- : controller_(controller),
- delegate_(delegate) {
+ : delegate_(delegate),
+ controller_(controller) {
DCHECK(controller_);
// If do delegate is supplied, use the default policy.
@@ -232,10 +239,10 @@ SSLManager::ErrorHandler::ErrorHandler(ResourceDispatcherHost* rdh,
: ui_loop_(ui_loop),
io_loop_(MessageLoop::current()),
manager_(NULL),
- resource_dispatcher_host_(rdh),
- request_has_been_notified_(false),
request_id_(0, 0),
- request_url_(request->url()) {
+ resource_dispatcher_host_(rdh),
+ request_url_(request->url()),
+ request_has_been_notified_(false) {
DCHECK(MessageLoop::current() != ui_loop);
ResourceDispatcherHost::ExtraRequestInfo* info =
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;