OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/toolbar/toolbar_actions_bar_bubble_views.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_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" |
11 #include "ui/views/controls/label.h" | 11 #include "ui/views/controls/label.h" |
12 #include "ui/views/layout/grid_layout.h" | 12 #include "ui/views/layout/grid_layout.h" |
13 #include "ui/views/layout/layout_constants.h" | 13 #include "ui/views/layout/layout_constants.h" |
14 | 14 |
15 ToolbarActionsBarBubbleViews::ToolbarActionsBarBubbleViews( | 15 ToolbarActionsBarBubbleViews::ToolbarActionsBarBubbleViews( |
16 views::View* anchor_view, | 16 views::View* anchor_view, |
17 scoped_ptr<ToolbarActionsBarBubbleDelegate> delegate) | 17 std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate) |
18 : views::BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), | 18 : views::BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), |
19 delegate_(std::move(delegate)), | 19 delegate_(std::move(delegate)), |
20 heading_label_(nullptr), | 20 heading_label_(nullptr), |
21 content_label_(nullptr), | 21 content_label_(nullptr), |
22 dismiss_button_(nullptr), | 22 dismiss_button_(nullptr), |
23 action_button_(nullptr), | 23 action_button_(nullptr), |
24 acknowledged_(false) {} | 24 acknowledged_(false) {} |
25 | 25 |
26 ToolbarActionsBarBubbleViews::~ToolbarActionsBarBubbleViews() {} | 26 ToolbarActionsBarBubbleViews::~ToolbarActionsBarBubbleViews() {} |
27 | 27 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 acknowledged_ = true; | 104 acknowledged_ = true; |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 void ToolbarActionsBarBubbleViews::ButtonPressed(views::Button* sender, | 108 void ToolbarActionsBarBubbleViews::ButtonPressed(views::Button* sender, |
109 const ui::Event& event) { | 109 const ui::Event& event) { |
110 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); | 110 delegate_->OnBubbleClosed(ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE); |
111 acknowledged_ = true; | 111 acknowledged_ = true; |
112 GetWidget()->Close(); | 112 GetWidget()->Close(); |
113 } | 113 } |
OLD | NEW |