Chromium Code Reviews| Index: chrome/browser/ui/views/content_setting_bubble_contents.cc |
| diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc |
| index 0ed18bd5296d27a26212ac106eb55f49ae2bff47..4b5553b960847d8ab19966affd4ff8c3e576ead1 100644 |
| --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc |
| +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc |
| @@ -162,8 +162,7 @@ ContentSettingBubbleContents::ContentSettingBubbleContents( |
| content_setting_bubble_model_(content_setting_bubble_model), |
| custom_link_(NULL), |
| manage_link_(NULL), |
| - learn_more_link_(NULL), |
| - close_button_(NULL) { |
| + learn_more_link_(NULL) { |
| // Compensate for built-in vertical padding in the anchor view's image. |
| set_anchor_view_insets(gfx::Insets( |
| GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
| @@ -380,6 +379,15 @@ views::View* ContentSettingBubbleContents::CreateExtraView() { |
| return manage_link_; |
| } |
| +bool ContentSettingBubbleContents::Accept() { |
| + content_setting_bubble_model_->OnDoneClicked(); |
| + return true; |
| +} |
| + |
| +bool ContentSettingBubbleContents::Close() { |
| + return true; |
| +} |
| + |
| int ContentSettingBubbleContents::GetDialogButtons() const { |
| return ui::DIALOG_BUTTON_OK; |
| } |
| @@ -394,7 +402,6 @@ void ContentSettingBubbleContents::DidNavigateMainFrame( |
| const content::FrameNavigateParams& params) { |
| // Content settings are based on the main frame, so if it switches then |
| // close up shop. |
| - content_setting_bubble_model_->OnDoneClicked(); |
| GetWidget()->Close(); |
| } |
| @@ -402,13 +409,8 @@ void ContentSettingBubbleContents::ButtonPressed(views::Button* sender, |
| const ui::Event& event) { |
| RadioGroup::const_iterator i( |
| std::find(radio_group_.begin(), radio_group_.end(), sender)); |
| - if (i != radio_group_.end()) { |
| - content_setting_bubble_model_->OnRadioClicked(i - radio_group_.begin()); |
| - return; |
| - } |
| - DCHECK_EQ(sender, close_button_); |
| - content_setting_bubble_model_->OnDoneClicked(); |
| - GetWidget()->Close(); |
| + DCHECK(i != radio_group_.end()); |
|
msw
2016/07/20 20:50:16
nit: DCHECK_NE?
Evan Stade
2016/07/20 20:56:46
DCHECK_NE seems more useful when you have two vari
|
| + content_setting_bubble_model_->OnRadioClicked(i - radio_group_.begin()); |
| } |
| void ContentSettingBubbleContents::LinkClicked(views::Link* source, |