OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/content_blocked_bubble_contents.h" | 5 #include "chrome/browser/views/content_blocked_bubble_contents.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/blocked_popup_container.h" | 8 #include "chrome/browser/blocked_popup_container.h" |
9 #include "chrome/browser/host_content_settings_map.h" | 9 #include "chrome/browser/host_content_settings_map.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 l10n_util::GetString(kBlockIDs[content_type_]), radio_button_group); | 172 l10n_util::GetString(kBlockIDs[content_type_]), radio_button_group); |
173 block_radio_->set_listener(this); | 173 block_radio_->set_listener(this); |
174 | 174 |
175 layout->StartRow(0, single_column_set_id); | 175 layout->StartRow(0, single_column_set_id); |
176 layout->AddView(allow_radio_); | 176 layout->AddView(allow_radio_); |
177 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 177 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
178 layout->StartRow(0, single_column_set_id); | 178 layout->StartRow(0, single_column_set_id); |
179 layout->AddView(block_radio_); | 179 layout->AddView(block_radio_); |
180 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 180 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
181 | 181 |
182 // Now that this has been added to the view hierarchy, it's safe to call | 182 // Now that the buttons have been added to the view hierarchy, it's safe to |
183 // SetChecked() on it. | 183 // call SetChecked() on them. |
184 block_radio_->SetChecked(true); | 184 if (profile_->GetHostContentSettingsMap()->GetContentSetting(host_, |
| 185 content_type_) == CONTENT_SETTING_ALLOW) |
| 186 allow_radio_->SetChecked(true); |
| 187 else |
| 188 block_radio_->SetChecked(true); |
185 | 189 |
186 views::Separator* separator = new views::Separator; | 190 views::Separator* separator = new views::Separator; |
187 layout->StartRow(0, single_column_set_id); | 191 layout->StartRow(0, single_column_set_id); |
188 layout->AddView(separator, 1, 1, GridLayout::FILL, GridLayout::FILL); | 192 layout->AddView(separator, 1, 1, GridLayout::FILL, GridLayout::FILL); |
189 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 193 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
190 } | 194 } |
191 | 195 |
192 const int double_column_set_id = 1; | 196 const int double_column_set_id = 1; |
193 views::ColumnSet* double_column_set = | 197 views::ColumnSet* double_column_set = |
194 layout->AddColumnSet(double_column_set_id); | 198 layout->AddColumnSet(double_column_set_id); |
(...skipping 14 matching lines...) Expand all Loading... |
209 manage_link_ = new views::Link(l10n_util::GetString(kLinkIDs[content_type_])); | 213 manage_link_ = new views::Link(l10n_util::GetString(kLinkIDs[content_type_])); |
210 manage_link_->SetController(this); | 214 manage_link_->SetController(this); |
211 | 215 |
212 layout->StartRow(0, double_column_set_id); | 216 layout->StartRow(0, double_column_set_id); |
213 layout->AddView(manage_link_); | 217 layout->AddView(manage_link_); |
214 | 218 |
215 close_button_ = | 219 close_button_ = |
216 new views::NativeButton(this, l10n_util::GetString(IDS_CLOSE)); | 220 new views::NativeButton(this, l10n_util::GetString(IDS_CLOSE)); |
217 layout->AddView(close_button_); | 221 layout->AddView(close_button_); |
218 } | 222 } |
OLD | NEW |