Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Issue 587003: Set the initial state of the content blocked bubble radio buttons correctly.... (Closed)

Created:
10 years, 10 months ago by Peter Kasting
Modified:
9 years, 7 months ago
Reviewers:
Elliot Glaysher
CC:
chromium-reviews, ben+cc_chromium.org
Visibility:
Public.

Description

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". Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=38388

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -4 lines) Patch
M chrome/browser/gtk/content_blocked_bubble_gtk.cc View 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/views/content_blocked_bubble_contents.cc View 1 chunk +7 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Peter Kasting
10 years, 10 months ago (2010-02-08 20:28:27 UTC) #1
Elliot Glaysher
10 years, 10 months ago (2010-02-08 20:36:22 UTC) #2
LGTM.

On Mon, Feb 8, 2010 at 12:28 PM,  <pkasting@chromium.org> wrote:
> Reviewers: Elliot Glaysher,
>
> Description:
> 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".
>
> Please review this at http://codereview.chromium.org/587003
>
> SVN Base: svn://chrome-svn/chrome/trunk/src/
>
> Affected files:
>  M     chrome/browser/gtk/content_blocked_bubble_gtk.cc
>  M     chrome/browser/views/content_blocked_bubble_contents.cc
>
>
> Index: chrome/browser/views/content_blocked_bubble_contents.cc
> ===================================================================
> --- chrome/browser/views/content_blocked_bubble_contents.cc     (revision
> 38381)
> +++ chrome/browser/views/content_blocked_bubble_contents.cc     (working
> copy)
> @@ -179,9 +179,13 @@
>     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);
> Index: chrome/browser/gtk/content_blocked_bubble_gtk.cc
> ===================================================================
> --- chrome/browser/gtk/content_blocked_bubble_gtk.cc    (revision 38381)
> +++ chrome/browser/gtk/content_blocked_bubble_gtk.cc    (working copy)
> @@ -132,7 +132,10 @@
>
>     // 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);
>
>
>

Powered by Google App Engine
This is Rietveld 408576698