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" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void BubbleController::UpdateAnchorPosition() { | 53 void BubbleController::UpdateAnchorPosition() { |
54 DCHECK(bubble_ui_); | 54 DCHECK(bubble_ui_); |
55 bubble_ui_->UpdateAnchorPosition(); | 55 bubble_ui_->UpdateAnchorPosition(); |
56 } | 56 } |
57 | 57 |
58 bool BubbleController::ShouldClose(BubbleCloseReason reason) const { | 58 bool BubbleController::ShouldClose(BubbleCloseReason reason) const { |
59 DCHECK(bubble_ui_); | 59 DCHECK(bubble_ui_); |
60 return delegate_->ShouldClose(reason) || reason == BUBBLE_CLOSE_FORCED; | 60 return delegate_->ShouldClose(reason) || reason == BUBBLE_CLOSE_FORCED; |
61 } | 61 } |
62 | 62 |
| 63 bool BubbleController::OwningFrameIs( |
| 64 const content::RenderFrameHost* frame) const { |
| 65 DCHECK(bubble_ui_); |
| 66 return delegate_->OwningFrame() == frame; |
| 67 } |
| 68 |
63 void BubbleController::DoClose() { | 69 void BubbleController::DoClose() { |
64 DCHECK(bubble_ui_); | 70 DCHECK(bubble_ui_); |
65 bubble_ui_->Close(); | 71 bubble_ui_->Close(); |
66 bubble_ui_.reset(); | 72 bubble_ui_.reset(); |
67 delegate_->DidClose(); | 73 delegate_->DidClose(); |
68 } | 74 } |
OLD | NEW |