diff options
author | markusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-22 14:19:50 +0000 |
---|---|---|
committer | markusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-22 14:19:50 +0000 |
commit | 04e7587372aadafa178a88c8ddbf8c0243453b5b (patch) | |
tree | 79ee30a7874f859624bd399be4c67a48b9d197b1 /chrome | |
parent | 8202a498a3529118e34e7b187456621f88513126 (diff) | |
download | chromium_src-04e7587372aadafa178a88c8ddbf8c0243453b5b.zip chromium_src-04e7587372aadafa178a88c8ddbf8c0243453b5b.tar.gz chromium_src-04e7587372aadafa178a88c8ddbf8c0243453b5b.tar.bz2 |
Revert 66942 - Disable content settings UI for managed content settings types (Views)
BUG=63178
TEST=none
Review URL: http://codereview.chromium.org/5116006
TBR=markusheintz@chromium.org
Review URL: http://codereview.chromium.org/5210005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66945 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
4 files changed, 6 insertions, 71 deletions
diff --git a/chrome/browser/ui/views/options/content_filter_page_view.cc b/chrome/browser/ui/views/options/content_filter_page_view.cc index eec979c..6b0c220 100644 --- a/chrome/browser/ui/views/options/content_filter_page_view.cc +++ b/chrome/browser/ui/views/options/content_filter_page_view.cc @@ -138,24 +138,7 @@ void ContentFilterPageView::InitControlLayout() { layout->AddView(block_radio_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - exceptions_button_ = new views::NativeButton(this, - l10n_util::GetString(IDS_COOKIES_EXCEPTIONS_BUTTON)); - - layout->StartRow(0, single_column_set_id); - layout->AddView(exceptions_button_, 1, 1, GridLayout::LEADING, - GridLayout::FILL); - - UpdateView(); - - registrar_.Add(this, NotificationType::CONTENT_SETTINGS_CHANGED, - NotificationService::AllSources()); -} - -/////////////////////////////////////////////////////////////////////////////// -// ContentFilterPageView, -void ContentFilterPageView::UpdateView() { ContentSetting default_setting; - bool is_content_type_managed = false; if (content_type_ == CONTENT_SETTINGS_TYPE_GEOLOCATION) { default_setting = profile()->GetGeolocationContentSettingsMap()-> GetDefaultContentSetting(); @@ -165,8 +148,6 @@ void ContentFilterPageView::UpdateView() { } else { default_setting = profile()->GetHostContentSettingsMap()-> GetDefaultContentSetting(content_type_); - is_content_type_managed = profile()->GetHostContentSettingsMap()-> - IsDefaultContentSettingManaged(content_type_); } // Now that these have been added to the view hierarchy, it's safe to call // SetChecked() on them. @@ -180,12 +161,12 @@ void ContentFilterPageView::UpdateView() { block_radio_->SetChecked(true); } - // Set enable state of the buttons. - allow_radio_->SetEnabled(!is_content_type_managed); - if (ask_radio_) - ask_radio_->SetEnabled(!is_content_type_managed); - block_radio_->SetEnabled(!is_content_type_managed); - exceptions_button_->SetEnabled(!is_content_type_managed); + exceptions_button_ = new views::NativeButton(this, + l10n_util::GetString(IDS_COOKIES_EXCEPTIONS_BUTTON)); + + layout->StartRow(0, single_column_set_id); + layout->AddView(exceptions_button_, 1, 1, GridLayout::LEADING, + GridLayout::FILL); } /////////////////////////////////////////////////////////////////////////////// @@ -248,23 +229,3 @@ void ContentFilterPageView::ButtonPressed(views::Button* sender, content_type_, default_setting); } } - -void ContentFilterPageView::NotifyContentSettingsChanged( - const HostContentSettingsMap::ContentSettingsDetails *details) { - if (details->type() == CONTENT_SETTINGS_TYPE_DEFAULT || - details->type() == content_type_) { - UpdateView(); - } -} - -void ContentFilterPageView::Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details) { - if (type == NotificationType::CONTENT_SETTINGS_CHANGED) { - NotifyContentSettingsChanged( - Details<HostContentSettingsMap::ContentSettingsDetails> - (details).ptr()); - } else { - OptionsPageBase::Observe(type, source, details); - } -} diff --git a/chrome/browser/ui/views/options/content_filter_page_view.h b/chrome/browser/ui/views/options/content_filter_page_view.h index dd4629e..baa96d10 100644 --- a/chrome/browser/ui/views/options/content_filter_page_view.h +++ b/chrome/browser/ui/views/options/content_filter_page_view.h @@ -6,10 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_OPTIONS_CONTENT_FILTER_PAGE_VIEW_H_ #pragma once -#include "chrome/browser/host_content_settings_map.h" #include "chrome/browser/views/options/options_page_view.h" #include "chrome/common/content_settings_types.h" -#include "chrome/common/notification_registrar.h" #include "views/controls/button/button.h" namespace views { @@ -29,18 +27,7 @@ class ContentFilterPageView : public OptionsPageView, ContentFilterPageView(Profile* profile, ContentSettingsType content_type); virtual ~ContentFilterPageView(); - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); protected: - // Updates the state of the UI. UpdateView is called when the content filter - // page is initialized and after the content setting changed (either the - // value or the is managed state). - virtual void UpdateView(); - - virtual void NotifyContentSettingsChanged( - const HostContentSettingsMap::ContentSettingsDetails *details); - // OptionsPageView implementation: virtual void InitControlLayout(); @@ -56,8 +43,6 @@ class ContentFilterPageView : public OptionsPageView, views::RadioButton* block_radio_; views::NativeButton* exceptions_button_; - NotificationRegistrar registrar_; - DISALLOW_IMPLICIT_CONSTRUCTORS(ContentFilterPageView); }; diff --git a/chrome/browser/ui/views/options/cookie_filter_page_view.cc b/chrome/browser/ui/views/options/cookie_filter_page_view.cc index 6cfeab7..d8ab81b 100644 --- a/chrome/browser/ui/views/options/cookie_filter_page_view.cc +++ b/chrome/browser/ui/views/options/cookie_filter_page_view.cc @@ -23,8 +23,6 @@ CookieFilterPageView::CookieFilterPageView(Profile* profile) show_cookies_button_(NULL) { clear_site_data_on_exit_.Init(prefs::kClearSiteDataOnExit, profile->GetPrefs(), NULL); - block_third_party_cookies_.Init(prefs::kBlockThirdPartyCookies, - profile->GetPrefs(), this); } CookieFilterPageView::~CookieFilterPageView() { @@ -89,12 +87,6 @@ void CookieFilterPageView::NotifyPrefChanged(const std::string* pref_name) { clear_on_close_check_->SetChecked( clear_site_data_on_exit_.GetValue()); } - if (!pref_name || *pref_name == prefs::kBlockThirdPartyCookies) { - block_3rdparty_check_->SetChecked( - block_third_party_cookies_.GetValue()); - block_3rdparty_check_->SetEnabled( - !block_third_party_cookies_.IsManaged()); - } } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/ui/views/options/cookie_filter_page_view.h b/chrome/browser/ui/views/options/cookie_filter_page_view.h index 4a03723..68c494f 100644 --- a/chrome/browser/ui/views/options/cookie_filter_page_view.h +++ b/chrome/browser/ui/views/options/cookie_filter_page_view.h @@ -45,9 +45,6 @@ class CookieFilterPageView : public ContentFilterPageView, // Clear locally stored site data on exit pref. BooleanPrefMember clear_site_data_on_exit_; - // Block all third party cookies. - BooleanPrefMember block_third_party_cookies_; - DISALLOW_IMPLICIT_CONSTRUCTORS(CookieFilterPageView); }; |