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 "components/bubble/bubble_controller.h" | 5 #include "components/bubble/bubble_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "components/bubble/bubble_delegate.h" | 9 #include "components/bubble/bubble_delegate.h" |
10 #include "components/bubble/bubble_manager.h" | 10 #include "components/bubble/bubble_manager.h" |
11 #include "components/bubble/bubble_ui.h" | 11 #include "components/bubble/bubble_ui.h" |
12 | 12 |
13 BubbleController::BubbleController(BubbleManager* manager, | 13 BubbleController::BubbleController(BubbleManager* manager, |
14 scoped_ptr<BubbleDelegate> delegate) | 14 std::unique_ptr<BubbleDelegate> delegate) |
15 : manager_(manager), delegate_(std::move(delegate)) { | 15 : manager_(manager), delegate_(std::move(delegate)) { |
16 DCHECK(manager_); | 16 DCHECK(manager_); |
17 DCHECK(delegate_); | 17 DCHECK(delegate_); |
18 } | 18 } |
19 | 19 |
20 BubbleController::~BubbleController() { | 20 BubbleController::~BubbleController() { |
21 if (bubble_ui_) | 21 if (bubble_ui_) |
22 ShouldClose(BUBBLE_CLOSE_FORCED); | 22 ShouldClose(BUBBLE_CLOSE_FORCED); |
23 } | 23 } |
24 | 24 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 DCHECK(bubble_ui_); | 65 DCHECK(bubble_ui_); |
66 return delegate_->OwningFrame() == frame; | 66 return delegate_->OwningFrame() == frame; |
67 } | 67 } |
68 | 68 |
69 void BubbleController::DoClose(BubbleCloseReason reason) { | 69 void BubbleController::DoClose(BubbleCloseReason reason) { |
70 DCHECK(bubble_ui_); | 70 DCHECK(bubble_ui_); |
71 bubble_ui_->Close(); | 71 bubble_ui_->Close(); |
72 bubble_ui_.reset(); | 72 bubble_ui_.reset(); |
73 delegate_->DidClose(reason); | 73 delegate_->DidClose(reason); |
74 } | 74 } |
OLD | NEW |