Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" | 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 | 201 |
| 202 const ContentSettingBubbleModel::RadioGroup& radio_group = | 202 const ContentSettingBubbleModel::RadioGroup& radio_group = |
| 203 bubble_content.radio_group; | 203 bubble_content.radio_group; |
| 204 if (!radio_group.radio_items.empty()) { | 204 if (!radio_group.radio_items.empty()) { |
| 205 if (!bubble_content_empty) | 205 if (!bubble_content_empty) |
| 206 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 206 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 207 for (ContentSettingBubbleModel::RadioItems::const_iterator i = | 207 for (ContentSettingBubbleModel::RadioItems::const_iterator i = |
| 208 radio_group.radio_items.begin(); | 208 radio_group.radio_items.begin(); |
| 209 i != radio_group.radio_items.end(); ++i) { | 209 i != radio_group.radio_items.end(); ++i) { |
| 210 views::RadioButton* radio = new views::RadioButton(UTF8ToUTF16(*i), 0); | 210 views::RadioButton* radio = new views::RadioButton(UTF8ToUTF16(*i), 0); |
| 211 if (!bubble_content.radio_group_enabled) | |
|
tfarina
2012/06/08 21:21:48
this seems logically correct. would be worth to do
markusheintz_
2012/06/11 13:25:04
Thanks for pointing this out.
I guess I can even
| |
| 212 radio->SetEnabled(false); | |
| 211 radio->set_listener(this); | 213 radio->set_listener(this); |
| 212 radio_group_.push_back(radio); | 214 radio_group_.push_back(radio); |
| 213 layout->StartRow(0, single_column_set_id); | 215 layout->StartRow(0, single_column_set_id); |
| 214 layout->AddView(radio); | 216 layout->AddView(radio); |
| 215 bubble_content_empty = false; | 217 bubble_content_empty = false; |
| 216 } | 218 } |
| 217 DCHECK(!radio_group_.empty()); | 219 DCHECK(!radio_group_.empty()); |
| 218 // Now that the buttons have been added to the view hierarchy, it's safe | 220 // Now that the buttons have been added to the view hierarchy, it's safe |
| 219 // to call SetChecked() on them. | 221 // to call SetChecked() on them. |
| 220 radio_group_[radio_group.default_item]->SetChecked(true); | 222 radio_group_[radio_group.default_item]->SetChecked(true); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 } | 325 } |
| 324 | 326 |
| 325 void ContentSettingBubbleContents::Observe( | 327 void ContentSettingBubbleContents::Observe( |
| 326 int type, | 328 int type, |
| 327 const content::NotificationSource& source, | 329 const content::NotificationSource& source, |
| 328 const content::NotificationDetails& details) { | 330 const content::NotificationDetails& details) { |
| 329 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 331 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
| 330 DCHECK(source == content::Source<WebContents>(web_contents_)); | 332 DCHECK(source == content::Source<WebContents>(web_contents_)); |
| 331 web_contents_ = NULL; | 333 web_contents_ = NULL; |
| 332 } | 334 } |
| OLD | NEW |