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 | |
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
-rw-r--r-- | chrome/browser/browser.scons | 3 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_blocking_page.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_blocking_page.h | 8 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_manager.cc | 29 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_policy.cc | 24 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.h | 3 | ||||
-rw-r--r-- | chrome/chrome.xcodeproj/project.pbxproj | 8 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 14 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 39 |
9 files changed, 64 insertions, 68 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index f32213f..c57ebe2 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -744,9 +744,6 @@ if not env.Bit('windows'): 'sessions/session_backend.cc', 'sessions/session_restore.cc', 'shell_integration.cc', - 'ssl/ssl_blocking_page.cc', - 'ssl/ssl_manager.cc', - 'ssl/ssl_policy.cc', 'tab_contents/infobar_delegate.cc', 'tab_contents/interstitial_page.cc', 'tab_contents/native_ui_contents.cc', 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; diff --git a/chrome/browser/tab_contents/navigation_controller.h b/chrome/browser/tab_contents/navigation_controller.h index f39c595..d84e563 100644 --- a/chrome/browser/tab_contents/navigation_controller.h +++ b/chrome/browser/tab_contents/navigation_controller.h @@ -12,14 +12,13 @@ #if defined(OS_POSIX) // TODO(port): remove when dependent classes are ported #include "chrome/common/temp_scaffolding_stubs.h" -#elif defined(OS_WIN) -#include "chrome/browser/ssl/ssl_manager.h" #endif #include "base/linked_ptr.h" #include "base/ref_counted.h" #include "googleurl/src/gurl.h" #include "chrome/browser/sessions/session_id.h" +#include "chrome/browser/ssl/ssl_manager.h" #include "chrome/browser/tab_contents/tab_contents_type.h" #include "chrome/common/navigation_types.h" #include "chrome/common/page_transition_types.h" diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj index addf9b3..e1be402 100644 --- a/chrome/chrome.xcodeproj/project.pbxproj +++ b/chrome/chrome.xcodeproj/project.pbxproj @@ -283,6 +283,7 @@ 844EA08D0F3E0C5000B0EF26 /* debugger_node.cc in Sources */ = {isa = PBXBuildFile; fileRef = 844EA07A0F3E0C1000B0EF26 /* debugger_node.cc */; }; 844EA08E0F3E0C5900B0EF26 /* debugger_wrapper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 844EA0820F3E0C1000B0EF26 /* debugger_wrapper.cc */; }; 8570EB3F140C07ABF1957F12 /* url_pattern_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = A9C335E39D39A7DE087850FC /* url_pattern_unittest.cc */; }; + 8CB218DCFAC761AC876C6531 /* ssl_blocking_page.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5D16ECB0F21451600861FAC /* ssl_blocking_page.cc */; }; 8F51B73AAAF1772ECF9BD180 /* url_fetcher.cc in Sources */ = {isa = PBXBuildFile; fileRef = 778D7927798B7E3FAA498D3D /* url_fetcher.cc */; }; 94542322A5E5A8F4FDDAB7F0 /* render_view_host_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = A76E42AD0F28EDB5009A7E88 /* render_view_host_manager.cc */; }; 9E85B39CA40439D93CE52E60 /* fav_icon_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF8760E9D4839009A6919 /* fav_icon_helper.cc */; }; @@ -347,10 +348,12 @@ BAC2B7A80F43595A0063A33E /* resource_dispatcher_host_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = BAC2B7A70F43594A0063A33E /* resource_dispatcher_host_unittest.cc */; }; BAC2B8AD0F436C7F0063A33E /* cross_site_resource_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = A7C613DC0F30D886008CEE5D /* cross_site_resource_handler.cc */; }; BADB8B710F3A35AC00989B26 /* resource_dispatcher_host.cc in Sources */ = {isa = PBXBuildFile; fileRef = BADB8B6D0F3A356000989B26 /* resource_dispatcher_host.cc */; }; + C53EBF7E1E204C3780FD4A7D /* ssl_policy.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5D16ED10F21451600861FAC /* ssl_policy.cc */; }; C8F5EB819EA38CE9D50AF5B5 /* history.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF9EC0E9D48F7009A6919 /* history.cc */; }; CA81330E0F423C4D0096C1DC /* query_parser_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFA020E9D48F7009A6919 /* query_parser_unittest.cc */; }; CA8133120F423C710096C1DC /* url_database_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFA150E9D48F7009A6919 /* url_database_unittest.cc */; }; CA81331D0F423DB40096C1DC /* pref_member_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBE70E9D4C9F009A6919 /* pref_member_unittest.cc */; }; + D87A8ECE6652FC99AF1ADA6F /* ssl_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = B5D16ECC0F21451600861FAC /* ssl_manager.cc */; }; DDB41CECE38B852000F30D9F /* browsing_data_remover.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF84E0E9D4839009A6919 /* browsing_data_remover.cc */; }; E40CC5E30F2E348900708647 /* history_contents_provider.cc in Sources */ = {isa = PBXBuildFile; fileRef = E40CC5E10F2E348900708647 /* history_contents_provider.cc */; }; E40CC5EE0F2E34C100708647 /* base_history_model.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF82B0E9D4839009A6919 /* base_history_model.cc */; }; @@ -560,6 +563,7 @@ E4F325D10EE83B71002533CE /* ipc_tests.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBBE0E9D4C9F009A6919 /* ipc_tests.cc */; }; E54EDFC97B4932925C31CB41 /* file_descriptor_set_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4590B61B84978823B2BADA68 /* file_descriptor_set_posix.cc */; }; E765478D55A73228BAD044E3 /* cert_store.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF8570E9D4839009A6919 /* cert_store.cc */; }; + F081CEE97F8C75FEAF3D0FD2 /* jstemplate_builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBC70E9D4C9F009A6919 /* jstemplate_builder.cc */; }; F47CA1280F44AE0E00FFFAFB /* libnet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7B004E0E9D5464009A6919 /* libnet.a */; }; F47CA1290F44AE2800FFFAFB /* libglue.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 826850180F2FC82E009F6555 /* libglue.a */; }; F47CA12A0F44AE3500FFFAFB /* libwtf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 826850240F2FC82E009F6555 /* libwtf.a */; }; @@ -5400,7 +5404,10 @@ E434BBB00F37D55800B665C7 /* site_instance.cc in Sources */, 4D7BFA2D0E9D4910009A6919 /* snippet.cc in Sources */, E45075FA0F150C28003BE099 /* spellcheck_worditerator.cc in Sources */, + 8CB218DCFAC761AC876C6531 /* ssl_blocking_page.cc in Sources */, F775995035B63E51251B0922 /* ssl_error_info.cc in Sources */, + D87A8ECE6652FC99AF1ADA6F /* ssl_manager.cc in Sources */, + C53EBF7E1E204C3780FD4A7D /* ssl_policy.cc in Sources */, E4F3245D0EE5CFDF002533CE /* starred_url_database.cc in Sources */, E45075EE0F150ABA003BE099 /* sync_resource_handler.cc in Sources */, E455DDBA0F3227A600DD4383 /* tab_cell.mm in Sources */, @@ -5534,6 +5541,7 @@ E4F3257D0EE83679002533CE /* ipc_message_utils.cc in Sources */, B507AC1F0F0048E10060FEE8 /* ipc_sync_message.cc in Sources */, 4D7BFC4B0E9D4D06009A6919 /* json_value_serializer.cc in Sources */, + F081CEE97F8C75FEAF3D0FD2 /* jstemplate_builder.cc in Sources */, B502DA520F098888005BE90C /* l10n_util.cc in Sources */, 4D7BFC540E9D4D09009A6919 /* libxml_utils.cc in Sources */, E4F3242C0EE5CBBF002533CE /* logging_chrome.cc in Sources */, diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index e64785d..46d7a78 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -376,20 +376,6 @@ void RunBeforeUnloadDialog(WebContents* web_contents, NOTIMPLEMENTED(); } -bool SSLManager::DeserializeSecurityInfo(const std::string&, int*, int*, int*) { - NOTIMPLEMENTED(); - return false; -} - -void SSLManager::OnSSLCertificateError( - ResourceDispatcherHost* resource_dispatcher, - URLRequest* request, - int cert_error, - net::X509Certificate* cert, - MessageLoop* ui_loop) { - NOTIMPLEMENTED(); -} - //-------------------------------------------------------------------------- void RunRepostFormWarningDialog(NavigationController*) { diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index def13b1..51e0cc4 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -32,6 +32,8 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/sessions/session_id.h" +#include "chrome/browser/ssl/ssl_error_info.h" +#include "chrome/browser/ssl/ssl_manager.h" #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/page_navigator.h" #include "chrome/browser/tab_contents/tab_contents_type.h" @@ -617,7 +619,16 @@ class TabContentsDelegate { class InterstitialPage { public: + InterstitialPage(WebContents* tab, bool new_navigation, const GURL& url) { + NOTIMPLEMENTED(); + } virtual void DontProceed() { NOTIMPLEMENTED(); } + virtual void Proceed() { NOTIMPLEMENTED(); } + virtual void Show() { NOTIMPLEMENTED(); } + WebContents* tab() const { + NOTIMPLEMENTED(); + return NULL; + } }; class InfoBarDelegate { @@ -973,34 +984,6 @@ class ConstrainedWindow { void CloseConstrainedWindow() { NOTIMPLEMENTED(); } }; -class SSLManager { - public: - class Delegate { - public: - }; - SSLManager(NavigationController* controller, Delegate* delegate) { - NOTIMPLEMENTED(); - } - ~SSLManager() { } - void NavigationStateChanged() { NOTIMPLEMENTED(); } - static bool DeserializeSecurityInfo(const std::string&, int*, int*, int*); - static void OnSSLCertificateError(ResourceDispatcherHost* rdh, - URLRequest* request, - int cert_error, - net::X509Certificate* cert, - MessageLoop* ui_loop); - static std::string SerializeSecurityInfo(int cert_id, - int cert_status, - int security_bits) { - NOTIMPLEMENTED(); - return std::string(); - } - static void OnMixedContentRequest(ResourceDispatcherHost* rdh, - URLRequest* request, - MessageLoop* ui_loop) { NOTIMPLEMENTED(); } - void OnMixedContent(MixedContentHandler* mixed_content) { NOTIMPLEMENTED(); } -}; - class ModalHtmlDialogDelegate { public: ModalHtmlDialogDelegate(const GURL&, int, int, const std::string&, |