summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/content_exceptions_window_controller.h4
-rw-r--r--chrome/browser/cocoa/content_exceptions_window_controller.mm24
-rw-r--r--chrome/browser/cocoa/content_exceptions_window_controller_unittest.mm4
-rw-r--r--chrome/browser/cocoa/content_settings_dialog_controller.h3
-rw-r--r--chrome/browser/cocoa/content_settings_dialog_controller.mm6
-rw-r--r--chrome/browser/cocoa/content_settings_dialog_controller_unittest.mm9
6 files changed, 18 insertions, 32 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);