| 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 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS); | 81 ToolbarActionsBarBubbleDelegate::CloseAction close_action = |
| 82 close_reason() == CloseReason::DEACTIVATION |
| 83 ? ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS_DEACTIVATION |
| 84 : ToolbarActionsBarBubbleDelegate::CLOSE_DISMISS_USER_ACTION; |
| 85 delegate_->OnBubbleClosed(close_action); |
| 82 acknowledged_ = true; | 86 acknowledged_ = true; |
| 83 } | 87 } |
| 84 } | 88 } |
| 85 | 89 |
| 86 void ExtensionToolbarIconSurfacingBubble::ButtonPressed( | 90 void ExtensionToolbarIconSurfacingBubble::ButtonPressed( |
| 87 views::Button* sender, | 91 views::Button* sender, |
| 88 const ui::Event& event) { | 92 const ui::Event& event) { |
| 89 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); | 93 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); |
| 90 acknowledged_ = true; | 94 acknowledged_ = true; |
| 91 GetWidget()->Close(); | 95 GetWidget()->Close(); |
| 92 } | 96 } |
| OLD | NEW |