OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bu
bble_views.h" | 5 #include "chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bu
bble_views.h" |
6 | 6 |
7 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" | 7 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" |
8 #include "chrome/grit/locale_settings.h" | 8 #include "chrome/grit/locale_settings.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/views/controls/button/label_button.h" | 10 #include "ui/views/controls/button/label_button.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 1, | 71 1, |
72 1, | 72 1, |
73 views::GridLayout::TRAILING, | 73 views::GridLayout::TRAILING, |
74 views::GridLayout::FILL); | 74 views::GridLayout::FILL); |
75 } | 75 } |
76 | 76 |
77 void ExtensionToolbarIconSurfacingBubble::OnWidgetDestroying( | 77 void ExtensionToolbarIconSurfacingBubble::OnWidgetDestroying( |
78 views::Widget* widget) { | 78 views::Widget* widget) { |
79 BubbleDelegateView::OnWidgetDestroying(widget); | 79 BubbleDelegateView::OnWidgetDestroying(widget); |
80 if (!acknowledged_) { | 80 if (!acknowledged_) { |
81 ToolbarActionsBarBubbleDelegate::CloseAction close_action = | 81 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS); |
82 close_reason() == CloseReason::DEACTIVATION | |
83 ? ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS_DEACTIVATION | |
84 : ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS_USER_ACTION; | |
85 delegate_->OnBubbleClosed(close_action); | |
86 acknowledged_ = true; | 82 acknowledged_ = true; |
87 } | 83 } |
88 } | 84 } |
89 | 85 |
90 void ExtensionToolbarIconSurfacingBubble::ButtonPressed( | 86 void ExtensionToolbarIconSurfacingBubble::ButtonPressed( |
91 views::Button* sender, | 87 views::Button* sender, |
92 const ui::Event& event) { | 88 const ui::Event& event) { |
93 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); | 89 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); |
94 acknowledged_ = true; | 90 acknowledged_ = true; |
95 GetWidget()->Close(); | 91 GetWidget()->Close(); |
96 } | 92 } |
OLD | NEW |