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

Unified Diff: chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc

Issue 1530493002: Remove Close button for chooser bubble and call CloseBubble when Cancel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use BUBBLE_CLOSE_CANCELED for bubble close reason in Cancel function Created 5 years 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/website_settings/chooser_bubble_ui_view.cc
diff --git a/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc b/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
index 15851bf48633194dcca349dd2d234725cfda7a3b..f874929d9ac4edd78cca46e1a08946dff4066056 100644
--- a/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
+++ b/chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc
@@ -74,7 +74,6 @@ class ChooserBubbleUiViewDelegate : public views::BubbleDelegateView,
void Close();
// BubbleDelegateView:
- bool ShouldShowCloseButton() const override;
bool ShouldShowWindowTitle() const override;
base::string16 GetWindowTitle() const override;
void OnWidgetDestroying(views::Widget* widget) override;
@@ -276,8 +275,10 @@ ChooserBubbleUiViewDelegate::ChooserBubbleUiViewDelegate(
ChooserBubbleUiViewDelegate::~ChooserBubbleUiViewDelegate() {
RemoveAllChildViews(true);
- if (owner_)
+ if (owner_) {
owner_->Close();
+ owner_ = nullptr;
Ken Rockot(use gerrit already) 2015/12/15 06:24:05 nit: No need to set this to nullptr
juncai 2015/12/15 17:23:39 Done.
+ }
chooser_table_model_->SetObserver(nullptr);
}
@@ -288,10 +289,6 @@ void ChooserBubbleUiViewDelegate::Close() {
GetWidget()->Close();
}
-bool ChooserBubbleUiViewDelegate::ShouldShowCloseButton() const {
- return true;
-}
-
bool ChooserBubbleUiViewDelegate::ShouldShowWindowTitle() const {
return true;
}
@@ -315,7 +312,10 @@ void ChooserBubbleUiViewDelegate::ButtonPressed(views::Button* button,
else
chooser_bubble_delegate_->Cancel();
button_pressed_ = true;
- owner_->Close();
+ if (owner_) {
+ owner_->Close();
+ owner_ = nullptr;
+ }
}
void ChooserBubbleUiViewDelegate::OnSelectionChanged() {
« no previous file with comments | « no previous file | chrome/browser/usb/usb_chooser_bubble_delegate.h » ('j') | chrome/browser/usb/web_usb_permission_bubble.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698