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

Unified Diff: chrome/browser/ui/views/content_setting_bubble_contents.cc

Issue 2169453003: Hide protocol handler icon in location bar after user is done (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698