diff options
15 files changed, 38 insertions, 77 deletions
diff --git a/chrome/browser/cocoa/content_exceptions_window_controller.h b/chrome/browser/cocoa/content_exceptions_window_controller.h index 131cf72..5c012f3 100644 --- a/chrome/browser/cocoa/content_exceptions_window_controller.h +++ b/chrome/browser/cocoa/content_exceptions_window_controller.h @@ -31,8 +31,8 @@ class UpdatingContentSettingsObserver; HostContentSettingsMap* otrSettingsMap_; // weak scoped_ptr<ContentExceptionsTableModel> model_; - // Is set if "Ask" should be a valid option in the "action" popup. - BOOL showAsk_; + // Is set if "Session" should be a valid option in the "action" popup. + BOOL showSession_; // Is set if adding and editing exceptions for the current OTR session should // be allowed. diff --git a/chrome/browser/cocoa/content_exceptions_window_controller.mm b/chrome/browser/cocoa/content_exceptions_window_controller.mm index dd7bd55..86de896 100644 --- a/chrome/browser/cocoa/content_exceptions_window_controller.mm +++ b/chrome/browser/cocoa/content_exceptions_window_controller.mm @@ -123,15 +123,14 @@ NSString* GetWindowTitle(ContentSettingsType settingsType) { const CGFloat kButtonBarHeight = 35.0; -// The settings shown in the combobox if showAsk_ is false; -const ContentSetting kNoAskSettings[] = { CONTENT_SETTING_ALLOW, - CONTENT_SETTING_BLOCK }; +// The settings shown in the combobox if showSession_ is false; +const ContentSetting kNoSessionSettings[] = { CONTENT_SETTING_ALLOW, + CONTENT_SETTING_BLOCK }; -// The settings shown in the combobox if showAsk_ is true; -const ContentSetting kAskSettings[] = { CONTENT_SETTING_ALLOW, - CONTENT_SETTING_ASK, - CONTENT_SETTING_SESSION_ONLY, - CONTENT_SETTING_BLOCK }; +// The settings shown in the combobox if showSession_ is true; +const ContentSetting kSessionSettings[] = { CONTENT_SETTING_ALLOW, + CONTENT_SETTING_SESSION_ONLY, + CONTENT_SETTING_BLOCK }; } // namespace @@ -168,7 +167,7 @@ static ContentExceptionsWindowController* otrSettingsMap_ = otrSettingsMap; model_.reset(new ContentExceptionsTableModel( settingsMap_, otrSettingsMap_, settingsType_)); - showAsk_ = settingsType_ == CONTENT_SETTINGS_TYPE_COOKIES; + showSession_ = settingsType_ == CONTENT_SETTINGS_TYPE_COOKIES; otrAllowed_ = otrSettingsMap != NULL; tableObserver_.reset(new UpdatingContentSettingsObserver(self)); updatesEnabled_ = YES; @@ -494,7 +493,8 @@ static ContentExceptionsWindowController* } - (size_t)menuItemCount { - return showAsk_ ? arraysize(kAskSettings) : arraysize(kNoAskSettings); + return showSession_ ? + arraysize(kSessionSettings) : arraysize(kNoSessionSettings); } - (NSString*)titleForIndex:(size_t)index { @@ -503,8 +503,6 @@ static ContentExceptionsWindowController* return l10n_util::GetNSStringWithFixup(IDS_EXCEPTIONS_ALLOW_BUTTON); case CONTENT_SETTING_BLOCK: return l10n_util::GetNSStringWithFixup(IDS_EXCEPTIONS_BLOCK_BUTTON); - case CONTENT_SETTING_ASK: - return l10n_util::GetNSStringWithFixup(IDS_EXCEPTIONS_ASK_BUTTON); case CONTENT_SETTING_SESSION_ONLY: return l10n_util::GetNSStringWithFixup( IDS_EXCEPTIONS_SESSION_ONLY_BUTTON); @@ -515,7 +513,7 @@ static ContentExceptionsWindowController* } - (ContentSetting)settingForIndex:(size_t)index { - return showAsk_ ? kAskSettings[index] : kNoAskSettings[index]; + return showSession_ ? kSessionSettings[index] : kNoSessionSettings[index]; } - (size_t)indexForSetting:(ContentSetting)setting { diff --git a/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm b/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm index 730a045..2c842b5 100644 --- a/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm +++ b/chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm @@ -220,7 +220,7 @@ TEST_F(ContentExceptionsWindowControllerTest, AddExistingEditAdd) { TEST_F(ContentExceptionsWindowControllerTest, AddExistingDoesNotOverwrite) { settingsMap_->SetContentSetting(HostContentSettingsMap::Pattern("myhost"), CONTENT_SETTINGS_TYPE_COOKIES, - CONTENT_SETTING_ASK); + CONTENT_SETTING_SESSION_ONLY); ContentExceptionsWindowController* controller = GetController(CONTENT_SETTINGS_TYPE_COOKIES); @@ -235,7 +235,7 @@ TEST_F(ContentExceptionsWindowControllerTest, AddExistingDoesNotOverwrite) { settingsMap_->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_COOKIES, &settings); EXPECT_EQ(1u, settings.size()); - EXPECT_EQ(CONTENT_SETTING_ASK, settings[0].second); + EXPECT_EQ(CONTENT_SETTING_SESSION_ONLY, settings[0].second); } diff --git a/chrome/browser/cocoa/content_settings_dialog_controller.h b/chrome/browser/cocoa/content_settings_dialog_controller.h index e705063..3e1013b 100644 --- a/chrome/browser/cocoa/content_settings_dialog_controller.h +++ b/chrome/browser/cocoa/content_settings_dialog_controller.h @@ -16,8 +16,7 @@ const NSInteger kContentSettingsDisabledIndex = 1; // Indices of the various cookie settings in the cookie radio group. const NSInteger kCookieEnabledIndex = 0; -const NSInteger kCookieAskIndex = 1; -const NSInteger kCookieDisabledIndex = 2; +const NSInteger kCookieDisabledIndex = 1; // Indices of the various geolocation settings in the geolocation radio group. const NSInteger kGeolocationEnabledIndex = 0; diff --git a/chrome/browser/cocoa/content_settings_dialog_controller.mm b/chrome/browser/cocoa/content_settings_dialog_controller.mm index 631e927..d98948d 100644 --- a/chrome/browser/cocoa/content_settings_dialog_controller.mm +++ b/chrome/browser/cocoa/content_settings_dialog_controller.mm @@ -234,7 +234,6 @@ class PrefObserverDisabler { ContentSetting setting = CONTENT_SETTING_DEFAULT; switch (value) { case kCookieEnabledIndex: setting = CONTENT_SETTING_ALLOW; break; - case kCookieAskIndex: setting = CONTENT_SETTING_ASK; break; case kCookieDisabledIndex: setting = CONTENT_SETTING_BLOCK; break; default: NOTREACHED(); @@ -249,9 +248,8 @@ class PrefObserverDisabler { - (NSInteger)cookieSettingIndex { switch (profile_->GetHostContentSettingsMap()->GetDefaultContentSetting( CONTENT_SETTINGS_TYPE_COOKIES)) { - case CONTENT_SETTING_ALLOW: return kCookieEnabledIndex; - case CONTENT_SETTING_ASK: return kCookieAskIndex; - case CONTENT_SETTING_BLOCK: return kCookieDisabledIndex; + case CONTENT_SETTING_ALLOW: return kCookieEnabledIndex; + case CONTENT_SETTING_BLOCK: return kCookieDisabledIndex; default: NOTREACHED(); return kCookieEnabledIndex; diff --git a/chrome/browser/cocoa/content_settings_dialog_controller_unittest.mm b/chrome/browser/cocoa/content_settings_dialog_controller_unittest.mm index abd3136..c0f1c32 100644 --- a/chrome/browser/cocoa/content_settings_dialog_controller_unittest.mm +++ b/chrome/browser/cocoa/content_settings_dialog_controller_unittest.mm @@ -55,10 +55,6 @@ TEST_F(ContentSettingsDialogControllerTest, CookieSetting) { EXPECT_EQ([controller_ cookieSettingIndex], kCookieEnabledIndex); settingsMap_->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, - CONTENT_SETTING_ASK); - EXPECT_EQ([controller_ cookieSettingIndex], kCookieAskIndex); - - settingsMap_->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK); EXPECT_EQ([controller_ cookieSettingIndex], kCookieDisabledIndex); @@ -69,11 +65,6 @@ TEST_F(ContentSettingsDialogControllerTest, CookieSetting) { settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); - [controller_ setCookieSettingIndex:kCookieAskIndex]; - setting = - settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES); - EXPECT_EQ(setting, CONTENT_SETTING_ASK); - [controller_ setCookieSettingIndex:kCookieDisabledIndex]; setting = settingsMap_->GetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES); diff --git a/chrome/browser/content_exceptions_table_model.cc b/chrome/browser/content_exceptions_table_model.cc index d7f1bb6..d149a6d 100644 --- a/chrome/browser/content_exceptions_table_model.cc +++ b/chrome/browser/content_exceptions_table_model.cc @@ -99,8 +99,6 @@ std::wstring ContentExceptionsTableModel::GetText(int row, int column_id) { return l10n_util::GetString(IDS_EXCEPTIONS_ALLOW_BUTTON); case CONTENT_SETTING_BLOCK: return l10n_util::GetString(IDS_EXCEPTIONS_BLOCK_BUTTON); - case CONTENT_SETTING_ASK: - return l10n_util::GetString(IDS_EXCEPTIONS_ASK_BUTTON); case CONTENT_SETTING_SESSION_ONLY: return l10n_util::GetString(IDS_EXCEPTIONS_SESSION_ONLY_BUTTON); default: diff --git a/chrome/browser/content_setting_combo_model.cc b/chrome/browser/content_setting_combo_model.cc index c6e990e..678ea73 100644 --- a/chrome/browser/content_setting_combo_model.cc +++ b/chrome/browser/content_setting_combo_model.cc @@ -9,27 +9,27 @@ namespace { -// The settings shown in the combobox if show_ask_ is false; -const ContentSetting kNoAskSettings[] = { CONTENT_SETTING_ALLOW, - CONTENT_SETTING_BLOCK }; +// The settings shown in the combobox if show_session_ is false; +const ContentSetting kNoSessionSettings[] = { CONTENT_SETTING_ALLOW, + CONTENT_SETTING_BLOCK }; -// The settings shown in the combobox if show_ask_ is true; -const ContentSetting kAskSettings[] = { CONTENT_SETTING_ALLOW, - CONTENT_SETTING_ASK, - CONTENT_SETTING_SESSION_ONLY, - CONTENT_SETTING_BLOCK }; +// The settings shown in the combobox if show_session_ is true; +const ContentSetting kSessionSettings[] = { CONTENT_SETTING_ALLOW, + CONTENT_SETTING_SESSION_ONLY, + CONTENT_SETTING_BLOCK }; } // namespace -ContentSettingComboModel::ContentSettingComboModel(bool show_ask) - : show_ask_(show_ask) { +ContentSettingComboModel::ContentSettingComboModel(bool show_session) + : show_session_(show_session) { } ContentSettingComboModel::~ContentSettingComboModel() { } int ContentSettingComboModel::GetItemCount() { - return show_ask_ ? arraysize(kAskSettings) : arraysize(kNoAskSettings); + return show_session_ ? + arraysize(kSessionSettings) : arraysize(kNoSessionSettings); } std::wstring ContentSettingComboModel::GetItemAt(int index) { @@ -38,8 +38,6 @@ std::wstring ContentSettingComboModel::GetItemAt(int index) { return l10n_util::GetString(IDS_EXCEPTIONS_ALLOW_BUTTON); case CONTENT_SETTING_BLOCK: return l10n_util::GetString(IDS_EXCEPTIONS_BLOCK_BUTTON); - case CONTENT_SETTING_ASK: - return l10n_util::GetString(IDS_EXCEPTIONS_ASK_BUTTON); case CONTENT_SETTING_SESSION_ONLY: return l10n_util::GetString(IDS_EXCEPTIONS_SESSION_ONLY_BUTTON); default: @@ -49,7 +47,7 @@ std::wstring ContentSettingComboModel::GetItemAt(int index) { } ContentSetting ContentSettingComboModel::SettingForIndex(int index) { - return show_ask_ ? kAskSettings[index] : kNoAskSettings[index]; + return show_session_ ? kSessionSettings[index] : kNoSessionSettings[index]; } int ContentSettingComboModel::IndexForSetting(ContentSetting setting) { diff --git a/chrome/browser/content_setting_combo_model.h b/chrome/browser/content_setting_combo_model.h index 751e9d0..255f02a 100644 --- a/chrome/browser/content_setting_combo_model.h +++ b/chrome/browser/content_setting_combo_model.h @@ -12,7 +12,7 @@ class ContentSettingComboModel : public ComboboxModel { public: - explicit ContentSettingComboModel(bool show_ask); + explicit ContentSettingComboModel(bool show_session); virtual ~ContentSettingComboModel(); virtual int GetItemCount(); @@ -24,7 +24,7 @@ class ContentSettingComboModel : public ComboboxModel { int IndexForSetting(ContentSetting); private: - const bool show_ask_; + const bool show_session_; DISALLOW_COPY_AND_ASSIGN(ContentSettingComboModel); }; diff --git a/chrome/browser/dom_ui/content_settings_handler.cc b/chrome/browser/dom_ui/content_settings_handler.cc index db59df4..c89fac3 100644 --- a/chrome/browser/dom_ui/content_settings_handler.cc +++ b/chrome/browser/dom_ui/content_settings_handler.cc @@ -63,8 +63,6 @@ std::string ContentSettingToString(ContentSetting setting) { switch (setting) { case CONTENT_SETTING_ALLOW: return "allow"; - case CONTENT_SETTING_ASK: - return "ask"; case CONTENT_SETTING_BLOCK: return "block"; @@ -77,8 +75,6 @@ std::string ContentSettingToString(ContentSetting setting) { ContentSetting ContentSettingFromString(const std::string& name) { if (name == "allow") return CONTENT_SETTING_ALLOW; - if (name == "ask") - return CONTENT_SETTING_ASK; if (name == "block") return CONTENT_SETTING_BLOCK; @@ -110,8 +106,6 @@ void ContentSettingsHandler::GetLocalizedValues( l10n_util::GetString(IDS_MODIFY_COOKIE_STORING_LABEL)); localized_strings->SetString(L"cookies_allow", l10n_util::GetString(IDS_COOKIES_ALLOW_RADIO)); - localized_strings->SetString(L"cookies_ask", - l10n_util::GetString(IDS_COOKIES_ASK_EVERY_TIME_RADIO)); localized_strings->SetString(L"cookies_block", l10n_util::GetString(IDS_COOKIES_BLOCK_RADIO)); localized_strings->SetString(L"cookies_block_3rd_party", diff --git a/chrome/browser/gtk/options/cookie_filter_page_gtk.cc b/chrome/browser/gtk/options/cookie_filter_page_gtk.cc index fbe7a92..878fdd0 100644 --- a/chrome/browser/gtk/options/cookie_filter_page_gtk.cc +++ b/chrome/browser/gtk/options/cookie_filter_page_gtk.cc @@ -72,13 +72,6 @@ GtkWidget* CookieFilterPageGtk::InitCookieStoringGroup() { G_CALLBACK(OnCookiesAllowToggledThunk), this); gtk_box_pack_start(GTK_BOX(vbox), allow_radio_, FALSE, FALSE, 0); - ask_every_time_radio_ = gtk_radio_button_new_with_label_from_widget( - GTK_RADIO_BUTTON(allow_radio_), - l10n_util::GetStringUTF8(IDS_COOKIES_ASK_EVERY_TIME_RADIO).c_str()); - g_signal_connect(G_OBJECT(ask_every_time_radio_), "toggled", - G_CALLBACK(OnCookiesAllowToggledThunk), this); - gtk_box_pack_start(GTK_BOX(vbox), ask_every_time_radio_, FALSE, FALSE, 0); - block_radio_ = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(allow_radio_), l10n_util::GetStringUTF8(IDS_COOKIES_BLOCK_RADIO).c_str()); @@ -96,11 +89,9 @@ GtkWidget* CookieFilterPageGtk::InitCookieStoringGroup() { GtkWidget* radio_button = NULL; if (default_setting == CONTENT_SETTING_ALLOW) { radio_button = allow_radio_; - } else if (default_setting == CONTENT_SETTING_BLOCK) { - radio_button = block_radio_; } else { - DCHECK(default_setting == CONTENT_SETTING_ASK); - radio_button = ask_every_time_radio_; + DCHECK(default_setting == CONTENT_SETTING_BLOCK); + radio_button = block_radio_; } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button), TRUE); @@ -157,8 +148,6 @@ void CookieFilterPageGtk::OnCookiesAllowToggled(GtkWidget* toggle_button) { ContentSetting setting = CONTENT_SETTING_ALLOW; if (toggle_button == allow_radio_) setting = CONTENT_SETTING_ALLOW; - else if (toggle_button == ask_every_time_radio_) - setting = CONTENT_SETTING_ASK; else if (toggle_button == block_radio_) setting = CONTENT_SETTING_BLOCK; diff --git a/chrome/browser/gtk/options/cookie_filter_page_gtk.h b/chrome/browser/gtk/options/cookie_filter_page_gtk.h index 3eb6bb1..062b099 100644 --- a/chrome/browser/gtk/options/cookie_filter_page_gtk.h +++ b/chrome/browser/gtk/options/cookie_filter_page_gtk.h @@ -43,7 +43,6 @@ class CookieFilterPageGtk : public OptionsPageBase { // Widgets of the cookie storing group GtkWidget* allow_radio_; - GtkWidget* ask_every_time_radio_; GtkWidget* block_radio_; GtkWidget* exceptions_button_; diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc index 590d5f0..611b645 100644 --- a/chrome/browser/host_content_settings_map.cc +++ b/chrome/browser/host_content_settings_map.cc @@ -569,6 +569,9 @@ void HostContentSettingsMap::GetSettingsFromDictionary( } } } + // Migrate obsolete cookie prompt mode. + if (settings->settings[CONTENT_SETTINGS_TYPE_COOKIES] == CONTENT_SETTING_ASK) + settings->settings[CONTENT_SETTINGS_TYPE_COOKIES] = CONTENT_SETTING_BLOCK; } void HostContentSettingsMap::ForceDefaultsToBeExplicit() { diff --git a/chrome/browser/resources/options/content_settings.html b/chrome/browser/resources/options/content_settings.html index b8c6d73..2e667cb 100644 --- a/chrome/browser/resources/options/content_settings.html +++ b/chrome/browser/resources/options/content_settings.html @@ -36,12 +36,6 @@ </tr> <tr> <td class="option-name"><label> - <input type="radio" name="cookies" value="ask"> - <span i18n-content="cookies_ask"></span> - </label></td> - </tr> - <tr> - <td class="option-name"><label> <input type="radio" name="cookies" value="block"> <span i18n-content="cookies_block"></span> </label></td> diff --git a/chrome/browser/views/options/content_filter_page_view.cc b/chrome/browser/views/options/content_filter_page_view.cc index 38fb8e8..299d6b3 100644 --- a/chrome/browser/views/options/content_filter_page_view.cc +++ b/chrome/browser/views/options/content_filter_page_view.cc @@ -88,7 +88,7 @@ void ContentFilterPageView::InitControlLayout() { layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); static const int kAskIDs[] = { - IDS_COOKIES_ASK_EVERY_TIME_RADIO, + 0, 0, 0, 0, |