summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 10:21:10 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 10:21:10 +0000
commitbee119bb4f8c817287d742b149a3c8394a80e9c7 (patch)
tree9146262538048f0d7660ac147ebadee3ca76fbb2 /chrome/browser/cocoa
parenta68dcca410f7726c1e379037bd12c85dffb922bc (diff)
downloadchromium_src-bee119bb4f8c817287d742b149a3c8394a80e9c7.zip
chromium_src-bee119bb4f8c817287d742b149a3c8394a80e9c7.tar.gz
chromium_src-bee119bb4f8c817287d742b149a3c8394a80e9c7.tar.bz2
Simplify content settings bubble model "radio groups" to a single radio group.
There's no longer a use case for multiple radio groups (was originally planned for Geolocation), simplify the model and its views. BUG=39073 TEST=content_setting_bubble_model_unittest Review URL: http://codereview.chromium.org/1575022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/content_blocked_bubble_controller.mm10
-rw-r--r--chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm2
2 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/content_blocked_bubble_controller.mm b/chrome/browser/cocoa/content_blocked_bubble_controller.mm
index 0455da1..fd4d979 100644
--- a/chrome/browser/cocoa/content_blocked_bubble_controller.mm
+++ b/chrome/browser/cocoa/content_blocked_bubble_controller.mm
@@ -171,14 +171,12 @@ NSTextField* LabelWithFrame(NSString* text, const NSRect& frame) {
- (void)initializeRadioGroup {
// Configure the radio group. For now, only deal with the
- // strictly needed case of 1 radio group (containing 2 radio buttons).
+ // strictly needed case of group containing 2 radio buttons.
// TODO(joth): Implement the generic case, getting localized strings from the
// bubble model instead of the xib, or remove it if it's never needed.
// http://crbug.com/38432
- const ContentSettingBubbleModel::RadioGroups& radioGroups =
- contentSettingBubbleModel_->bubble_content().radio_groups;
- DCHECK_EQ(1u, radioGroups.size()) << "Only one radio group supported";
- const ContentSettingBubbleModel::RadioGroup& radioGroup = radioGroups.at(0);
+ const ContentSettingBubbleModel::RadioGroup& radioGroup =
+ contentSettingBubbleModel_->bubble_content().radio_group;
// Select appropriate radio button..
[allowBlockRadioGroup_ selectCellWithTag:
@@ -460,7 +458,7 @@ NSTextField* LabelWithFrame(NSString* text, const NSRect& frame) {
- (IBAction)allowBlockToggled:(id)sender {
NSButtonCell *selectedCell = [sender selectedCell];
contentSettingBubbleModel_->OnRadioClicked(
- 0, [selectedCell tag] == kAllowTag ? 0 : 1);
+ [selectedCell tag] == kAllowTag ? 0 : 1);
}
- (IBAction)closeBubble:(id)sender {
diff --git a/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm b/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm
index 2bd8533d..a7b940e 100644
--- a/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm
+++ b/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm
@@ -21,7 +21,7 @@ class DummyContentSettingBubbleModel : public ContentSettingBubbleModel {
RadioGroup radio_group;
radio_group.default_item = 0;
radio_group.radio_items.resize(2);
- add_radio_group(radio_group);
+ set_radio_group(radio_group);
}
};