diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 03:42:50 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 03:42:50 +0000 |
commit | 1d4d6c674e6b3a932fbd4c33e8067e88031624d1 (patch) | |
tree | 31c8ccbf25c506bbc32861ba02cabbea5ca3fb40 /chrome | |
parent | d82ed61e761310023c71800a03e03395197c5b64 (diff) | |
download | chromium_src-1d4d6c674e6b3a932fbd4c33e8067e88031624d1.zip chromium_src-1d4d6c674e6b3a932fbd4c33e8067e88031624d1.tar.gz chromium_src-1d4d6c674e6b3a932fbd4c33e8067e88031624d1.tar.bz2 |
Removed mixed content options. Turns out extremely few users changed the default.
R=beng
BUG=None
TEST=Go to options dialog and notice that the mixed content option is gone.
Review URL: http://codereview.chromium.org/126106
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/ssl/ssl_policy.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_uitest.cc | 66 | ||||
-rw-r--r-- | chrome/browser/views/options/advanced_contents_view.cc | 96 |
3 files changed, 2 insertions, 165 deletions
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc index b453092..d1b3bf3 100644 --- a/chrome/browser/ssl/ssl_policy.cc +++ b/chrome/browser/ssl/ssl_policy.cc @@ -113,10 +113,7 @@ void SSLPolicy::OnCertError(SSLCertErrorHandler* handler) { } void SSLPolicy::OnMixedContent(SSLMixedContentHandler* handler) { - // Get the user's mixed content preference. - PrefService* prefs = handler->GetTabContents()->profile()->GetPrefs(); - FilterPolicy::Type filter_policy = - FilterPolicy::FromInt(prefs->GetInteger(prefs::kMixedContentFiltering)); + FilterPolicy::Type filter_policy = FilterPolicy::DONT_FILTER; // If the user has added an exception, doctor the |filter_policy|. std::string host = GURL(handler->main_frame_origin()).host(); diff --git a/chrome/browser/ssl/ssl_uitest.cc b/chrome/browser/ssl/ssl_uitest.cc index 00bd8bd..a29d1c7 100644 --- a/chrome/browser/ssl/ssl_uitest.cc +++ b/chrome/browser/ssl/ssl_uitest.cc @@ -271,72 +271,6 @@ TEST_F(SSLUITest, TestMixedContents) { EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state); } -// Visits a page with mixed content. -TEST_F(SSLUITest, TestMixedContentsFilterAll) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); - if (HasFailure()) - return; - - // Now select the block mixed-content pref and reload the page. - scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); - EXPECT_TRUE(browser_proxy.get()); - EXPECT_TRUE(browser_proxy->SetIntPreference(prefs::kMixedContentFiltering, - FilterPolicy::FILTER_ALL)); - - // Load a page with mixed-content, we've overridden our filtering policy so - // we won't load the mixed content by default. - scoped_refptr<TabProxy> tab(GetActiveTabProxy()); - NavigateTab( - tab.get(), - https_server->TestServerPageW( - L"files/ssl/page_with_mixed_contents.html")); - NavigationEntry::PageType page_type; - EXPECT_TRUE(tab->GetPageType(&page_type)); - EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); - - // The image should be filtered. - int img_width; - EXPECT_TRUE(tab->ExecuteAndExtractInt(L"", - L"window.domAutomationController.send(ImageWidth());", - &img_width)); - // In order to check that the image was not loaded, we check its width. - // The actual image (Google logo) is 114 pixels wide, we assume the broken - // image is less than 100. - EXPECT_GT(100, img_width); - - SecurityStyle security_style; - int cert_status; - int mixed_content_state; - // The state should be OK since we are not showing the resource. - EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status, - &mixed_content_state)); - EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, security_style); - EXPECT_EQ(0, cert_status & net::CERT_STATUS_ALL_ERRORS); - EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); - - // There should be one info-bar to show the mixed-content. - int info_bar_count = 0; - EXPECT_TRUE(tab->GetSSLInfoBarCount(&info_bar_count)); - EXPECT_EQ(1, info_bar_count); - - // Activate the link on the info-bar to show the mixed-content. - EXPECT_TRUE(tab->ClickSSLInfoBarLink(0, true)); - - // The image should show now. - EXPECT_TRUE(tab->ExecuteAndExtractInt(L"", - L"window.domAutomationController.send(ImageWidth());", - &img_width)); - EXPECT_LT(100, img_width); - - // And our status should be mixed-content. - EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status, - &mixed_content_state)); - EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, security_style); - EXPECT_EQ(0, cert_status & net::CERT_STATUS_ALL_ERRORS); - EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state); -} - // Visits a page with an http script that tries to suppress our mixed content // warnings by randomize location.hash. // Based on http://crbug.com/8706 diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index e94c040..5d6fbb9 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -32,7 +32,6 @@ #include "chrome/browser/views/options/fonts_languages_window_view.h" #include "chrome/browser/views/options/language_combobox_model.h" #include "chrome/browser/views/restart_message_box.h" -#include "chrome/common/filter_policy.h" #include "chrome/common/pref_member.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" @@ -869,47 +868,8 @@ void WebContentSection::InitControlLayout() { //////////////////////////////////////////////////////////////////////////////// // SecuritySection -class MixedContentComboModel : public views::Combobox::Model { - public: - MixedContentComboModel() {} - - // Return the number of items in the combo box. - virtual int GetItemCount(views::Combobox* source) { - return 3; - } - - virtual std::wstring GetItemAt(views::Combobox* source, int index) { - const int kStringIDs[] = { - IDS_OPTIONS_INCLUDE_MIXED_CONTENT, - IDS_OPTIONS_INCLUDE_MIXED_CONTENT_IMAGE_ONLY, - IDS_OPTIONS_INCLUDE_NO_MIXED_CONTENT - }; - if (index >= 0 && index < arraysize(kStringIDs)) - return l10n_util::GetString(kStringIDs[index]); - - NOTREACHED(); - return L""; - } - - static int FilterPolicyToIndex(FilterPolicy::Type policy) { - return policy; - } - - static FilterPolicy::Type IndexToFilterPolicy(int index) { - if (FilterPolicy::ValidType(index)) - return FilterPolicy::FromInt(index); - - NOTREACHED(); - return FilterPolicy::DONT_FILTER; - } - - private: - DISALLOW_COPY_AND_ASSIGN(MixedContentComboModel); -}; - class SecuritySection : public AdvancedSection, - public views::ButtonListener, - public views::Combobox::Listener { + public views::ButtonListener { public: explicit SecuritySection(Profile* profile); virtual ~SecuritySection() {} @@ -917,11 +877,6 @@ class SecuritySection : public AdvancedSection, // Overridden from views::ButtonListener: virtual void ButtonPressed(views::Button* sender); - // Overridden from views::Combobox::Listener: - virtual void ItemChanged(views::Combobox* sender, - int prev_index, - int new_index); - protected: // OptionsPageView overrides: virtual void InitControlLayout(); @@ -932,16 +887,9 @@ class SecuritySection : public AdvancedSection, views::Label* ssl_info_label_; views::Checkbox* enable_ssl2_checkbox_; views::Checkbox* check_for_cert_revocation_checkbox_; - views::Label* mixed_content_info_label_; - views::Combobox* mixed_content_combobox_; views::Label* manage_certificates_label_; views::NativeButton* manage_certificates_button_; - // The contents of the mixed content combobox. - scoped_ptr<MixedContentComboModel> mixed_content_model_; - - IntegerPrefMember filter_mixed_content_; - DISALLOW_COPY_AND_ASSIGN(SecuritySection); }; @@ -949,8 +897,6 @@ SecuritySection::SecuritySection(Profile* profile) : ssl_info_label_(NULL), enable_ssl2_checkbox_(NULL), check_for_cert_revocation_checkbox_(NULL), - mixed_content_info_label_(NULL), - mixed_content_combobox_(NULL), manage_certificates_label_(NULL), manage_certificates_button_(NULL), AdvancedSection(profile, @@ -983,25 +929,6 @@ void SecuritySection::ButtonPressed(views::Button* sender) { } } -void SecuritySection::ItemChanged(views::Combobox* sender, - int prev_index, - int new_index) { - if (sender == mixed_content_combobox_) { - // TODO(jcampan): bug #1112812: change this to the real enum once we have - // piped the images only filtering. - FilterPolicy::Type filter_policy = - MixedContentComboModel::IndexToFilterPolicy(new_index); - const wchar_t* kUserMetrics[] = { - L"Options_FilterNone", - L"Options_FilterAllExceptImages", - L"Options_FilterAll" - }; - DCHECK(filter_policy >= 0 && filter_policy < arraysize(kUserMetrics)); - UserMetricsRecordAction(kUserMetrics[filter_policy], profile()->GetPrefs()); - filter_mixed_content_.SetValue(filter_policy); - } -} - void SecuritySection::InitControlLayout() { AdvancedSection::InitControlLayout(); @@ -1013,12 +940,6 @@ void SecuritySection::InitControlLayout() { check_for_cert_revocation_checkbox_ = new views::Checkbox( l10n_util::GetString(IDS_OPTIONS_SSL_CHECKREVOCATION)); check_for_cert_revocation_checkbox_->set_listener(this); - mixed_content_info_label_ = new views::Label( - l10n_util::GetString(IDS_OPTIONS_MIXED_CONTENT_LABEL)); - mixed_content_model_.reset(new MixedContentComboModel); - mixed_content_combobox_ = new views::Combobox( - mixed_content_model_.get()); - mixed_content_combobox_->set_listener(this); manage_certificates_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_LABEL)); manage_certificates_button_ = new views::NativeButton( @@ -1049,25 +970,10 @@ void SecuritySection::InitControlLayout() { indented_column_set_id, true); AddWrappingCheckboxRow(layout, check_for_cert_revocation_checkbox_, indented_column_set_id, false); - - // Mixed content controls. - AddWrappingLabelRow(layout, mixed_content_info_label_, - single_column_view_set_id, true); - AddLeadingControl(layout, mixed_content_combobox_, - indented_column_set_id, false); - - // Init member prefs so we can update the controls if prefs change. - filter_mixed_content_.Init(prefs::kMixedContentFiltering, - profile()->GetPrefs(), this); } // This method is called with a null pref_name when the dialog is initialized. void SecuritySection::NotifyPrefChanged(const std::wstring* pref_name) { - if (!pref_name || *pref_name == prefs::kMixedContentFiltering) { - mixed_content_combobox_->SetSelectedItem( - MixedContentComboModel::FilterPolicyToIndex( - FilterPolicy::FromInt(filter_mixed_content_.GetValue()))); - } // These SSL options are system settings and stored in the OS. if (!pref_name) { net::SSLConfig config; |