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

Unified Diff: ui/views/bubble/bubble_delegate.cc

Issue 1456213002: Revert of [Extensions] Don't count bubble dismissal from focus loss as acknowledgment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/bubble/bubble_delegate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_delegate.cc
diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc
index afed9df22238ae4374589be57271bd93d4973f9d..184a8ac8007028b4ac4999079f48cf7784a06da7 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -67,8 +67,9 @@
UpdateColorsFromTheme(GetNativeTheme());
}
-BubbleDelegateView::BubbleDelegateView(View* anchor_view,
- BubbleBorder::Arrow arrow)
+BubbleDelegateView::BubbleDelegateView(
+ View* anchor_view,
+ BubbleBorder::Arrow arrow)
: close_on_esc_(true),
close_on_deactivate_(true),
anchor_view_storage_id_(ViewStorage::GetInstance()->CreateStorageID()),
@@ -80,8 +81,7 @@
accept_events_(true),
border_accepts_events_(true),
adjust_if_offscreen_(true),
- parent_window_(NULL),
- close_reason_(CloseReason::UNKNOWN) {
+ parent_window_(NULL) {
SetAnchorView(anchor_view);
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
UpdateColorsFromTheme(GetNativeTheme());
@@ -151,14 +151,6 @@
return kViewClassName;
}
-void BubbleDelegateView::OnWidgetClosing(Widget* widget) {
- DCHECK(GetBubbleFrameView());
- if (widget == GetWidget() && close_reason_ == CloseReason::UNKNOWN &&
- GetBubbleFrameView()->close_button_clicked()) {
- close_reason_ = CloseReason::CLOSE_BUTTON;
- }
-}
-
void BubbleDelegateView::OnWidgetDestroying(Widget* widget) {
if (anchor_widget() == widget)
SetAnchorView(NULL);
@@ -183,11 +175,8 @@
void BubbleDelegateView::OnWidgetActivationChanged(Widget* widget,
bool active) {
- if (close_on_deactivate() && widget == GetWidget() && !active) {
- if (close_reason_ == CloseReason::UNKNOWN)
- close_reason_ = CloseReason::DEACTIVATION;
+ if (close_on_deactivate() && widget == GetWidget() && !active)
GetWidget()->Close();
- }
}
void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget,
@@ -232,7 +221,6 @@
const ui::Accelerator& accelerator) {
if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE)
return false;
- close_reason_ = CloseReason::ESCAPE;
GetWidget()->Close();
return true;
}
« no previous file with comments | « ui/views/bubble/bubble_delegate.h ('k') | ui/views/bubble/bubble_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698