| 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 radio->SetEnabled(bubble_content.radio_group_enabled); |
| 211 radio->set_listener(this); | 212 radio->set_listener(this); |
| 212 radio_group_.push_back(radio); | 213 radio_group_.push_back(radio); |
| 213 layout->StartRow(0, single_column_set_id); | 214 layout->StartRow(0, single_column_set_id); |
| 214 layout->AddView(radio); | 215 layout->AddView(radio); |
| 215 bubble_content_empty = false; | 216 bubble_content_empty = false; |
| 216 } | 217 } |
| 217 DCHECK(!radio_group_.empty()); | 218 DCHECK(!radio_group_.empty()); |
| 218 // Now that the buttons have been added to the view hierarchy, it's safe | 219 // Now that the buttons have been added to the view hierarchy, it's safe |
| 219 // to call SetChecked() on them. | 220 // to call SetChecked() on them. |
| 220 radio_group_[radio_group.default_item]->SetChecked(true); | 221 radio_group_[radio_group.default_item]->SetChecked(true); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 324 } |
| 324 | 325 |
| 325 void ContentSettingBubbleContents::Observe( | 326 void ContentSettingBubbleContents::Observe( |
| 326 int type, | 327 int type, |
| 327 const content::NotificationSource& source, | 328 const content::NotificationSource& source, |
| 328 const content::NotificationDetails& details) { | 329 const content::NotificationDetails& details) { |
| 329 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
| 330 DCHECK(source == content::Source<WebContents>(web_contents_)); | 331 DCHECK(source == content::Source<WebContents>(web_contents_)); |
| 331 web_contents_ = NULL; | 332 web_contents_ = NULL; |
| 332 } | 333 } |
| OLD | NEW |