summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl_policy.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 17:42:42 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-24 17:42:42 +0000
commit8a3422c9488ce79e305973d29a01811762e35465 (patch)
tree7fc94cb7aa013f7bb2afaf4100b1a8f45208cc00 /chrome/browser/ssl_policy.cc
parent5eb64653873981c7dbf693a9aba7c7da011b14a3 (diff)
downloadchromium_src-8a3422c9488ce79e305973d29a01811762e35465.zip
chromium_src-8a3422c9488ce79e305973d29a01811762e35465.tar.gz
chromium_src-8a3422c9488ce79e305973d29a01811762e35465.tar.bz2
This CL adds new UI tests for the SSL UI.
Some more info: SSL UI Tests: Added new tests for redirects and frames. Also improved the mixed-content test to exercise the "block mixed-contents" preference and the show info-bar. Automation: For the new UI tests, added methods to tab_proxy and browser_proxy. The ones of most interest are GetLastNavigatinTime and WaitForNavigation that ensures we wait for a navigation to occur or have occured when taking actions that asynchronously trigger navigations. Resource loading: Added a flag to the response we get when loading a resource that indicates whether that resource was filtered (blocked or altered) by the security peer. We use this flag to notify back the browser when we report a load has been committed. This is so the SSL manager knows a frame has been filtered (in which case we have no cert info but should not consider that as unsafe). BUG=2004 Review URL: http://codereview.chromium.org/3165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2553 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl_policy.cc')
-rw-r--r--chrome/browser/ssl_policy.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/chrome/browser/ssl_policy.cc b/chrome/browser/ssl_policy.cc
index d75b895..a93b31d 100644
--- a/chrome/browser/ssl_policy.cc
+++ b/chrome/browser/ssl_policy.cc
@@ -318,7 +318,21 @@ class DefaultPolicy : public SSLPolicy {
mixed_content_handler->StartRequest(filter_policy);
NavigationEntry* entry = navigation_controller->GetActiveEntry();
- entry->ssl().set_has_mixed_content();
+ // Even though we are loading the mixed-content resource, it will not be
+ // included in the page when we set the policy to FILTER_ALL or
+ // FILTER_ALL_EXCEPT_IMAGES (only images and they are stamped with warning
+ // icons), so we don't set the mixed-content mode in these cases.
+ if (filter_policy == FilterPolicy::DONT_FILTER)
+ entry->ssl().set_has_mixed_content();
+
+ // Print a message indicating the mixed-contents resource in the console.
+ const std::wstring& msg = l10n_util::GetStringF(
+ IDS_MIXED_CONTENT_LOG_MESSAGE,
+ UTF8ToWide(entry->url().spec()),
+ UTF8ToWide(mixed_content_handler->request_url().spec()));
+ mixed_content_handler->manager()->
+ AddMessageToConsole(msg, MESSAGE_LEVEL_WARNING);
+
NotificationService::current()->Notify(
NOTIFY_SSL_STATE_CHANGED,
Source<NavigationController>(navigation_controller),
@@ -414,25 +428,6 @@ void SSLPolicy::OnRequestStarted(SSLManager* manager, const GURL& url,
}
}
- // Note that when navigating to an inner-frame, we get this notification
- // before the new navigation entry is created. For now we just copy the
- // mixed/unsafe content state from the old entry to the new one. It is OK
- // to set the state on the wrong entry, as if we navigate back to it, its
- // state will be reset.
-
- // Now check for mixed content.
- if (entry->url().SchemeIsSecure() && !url.SchemeIsSecure()) {
- if (!ssl.has_mixed_content()) {
- changed = true;
- ssl.set_has_mixed_content();
- }
- const std::wstring& msg = l10n_util::GetStringF(
- IDS_MIXED_CONTENT_LOG_MESSAGE,
- UTF8ToWide(entry->url().spec()),
- UTF8ToWide(url.spec()));
- manager->AddMessageToConsole(msg, MESSAGE_LEVEL_WARNING);
- }
-
if (changed) {
// Only send the notification when something actually changed.
NotificationService::current()->Notify(