diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 20:46:00 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 20:46:00 +0000 |
commit | 49a001691fa5791a7e6b47afdcae695d8c6e8ed9 (patch) | |
tree | 003eb0f2d103c87fba05efe301245c5940987bb6 | |
parent | f972bb64547f2c177e2968cae838a42eb0c23b3f (diff) | |
download | chromium_src-49a001691fa5791a7e6b47afdcae695d8c6e8ed9.zip chromium_src-49a001691fa5791a7e6b47afdcae695d8c6e8ed9.tar.gz chromium_src-49a001691fa5791a7e6b47afdcae695d8c6e8ed9.tar.bz2 |
Set the initial state of the content blocked bubble radio buttons correctly.
BUG=34781
TEST=Go to a page where content is blocked, open the bubble, change the radio button to "allow", open the bubble again, and make sure it's still "allow".
Review URL: http://codereview.chromium.org/587003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38388 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/content_blocked_bubble_gtk.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/content_blocked_bubble_contents.cc | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/gtk/content_blocked_bubble_gtk.cc b/chrome/browser/gtk/content_blocked_bubble_gtk.cc index 4f87c5a..dbfa7bc 100644 --- a/chrome/browser/gtk/content_blocked_bubble_gtk.cc +++ b/chrome/browser/gtk/content_blocked_bubble_gtk.cc @@ -132,7 +132,10 @@ void ContentBlockedBubbleGtk::BuildBubble() { // We must set the default value before we attach the signal handlers or // pain occurs. - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(block_radio_), TRUE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( + (profile_->GetHostContentSettingsMap()->GetContentSetting(host_, + content_type_) == CONTENT_SETTING_ALLOW) ? + allow_radio_ : block_radio_), TRUE); g_signal_connect(G_OBJECT(allow_radio_), "toggled", G_CALLBACK(OnAllowBlockToggled), this); diff --git a/chrome/browser/views/content_blocked_bubble_contents.cc b/chrome/browser/views/content_blocked_bubble_contents.cc index 601562f..f3d5635 100644 --- a/chrome/browser/views/content_blocked_bubble_contents.cc +++ b/chrome/browser/views/content_blocked_bubble_contents.cc @@ -179,9 +179,13 @@ void ContentBlockedBubbleContents::InitControlLayout() { layout->AddView(block_radio_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - // Now that this has been added to the view hierarchy, it's safe to call - // SetChecked() on it. - block_radio_->SetChecked(true); + // Now that the buttons have been added to the view hierarchy, it's safe to + // call SetChecked() on them. + if (profile_->GetHostContentSettingsMap()->GetContentSetting(host_, + content_type_) == CONTENT_SETTING_ALLOW) + allow_radio_->SetChecked(true); + else + block_radio_->SetChecked(true); views::Separator* separator = new views::Separator; layout->StartRow(0, single_column_set_id); |