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_manager.h" | 5 #include "components/bubble/bubble_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "components/bubble/bubble_controller.h" | 9 #include "components/bubble/bubble_controller.h" |
10 #include "components/bubble/bubble_delegate.h" | 10 #include "components/bubble/bubble_delegate.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 ShowPendingBubbles(); | 81 ShowPendingBubbles(); |
82 } | 82 } |
83 | 83 |
84 void BubbleManager::UpdateAllBubbleAnchors() { | 84 void BubbleManager::UpdateAllBubbleAnchors() { |
85 DCHECK(thread_checker_.CalledOnValidThread()); | 85 DCHECK(thread_checker_.CalledOnValidThread()); |
86 for (auto controller : controllers_) | 86 for (auto controller : controllers_) |
87 controller->UpdateAnchorPosition(); | 87 controller->UpdateAnchorPosition(); |
88 } | 88 } |
89 | 89 |
| 90 bool BubbleManager::UpdateBubbleUI(BubbleReference bubble) { |
| 91 DCHECK(thread_checker_.CalledOnValidThread()); |
| 92 return bubble->UpdateBubbleUIInternal(); |
| 93 } |
| 94 |
90 void BubbleManager::ShowPendingBubbles() { | 95 void BubbleManager::ShowPendingBubbles() { |
91 if (manager_state_ == QUEUE_BUBBLES) | 96 if (manager_state_ == QUEUE_BUBBLES) |
92 manager_state_ = SHOW_BUBBLES; | 97 manager_state_ = SHOW_BUBBLES; |
93 | 98 |
94 if (manager_state_ == SHOW_BUBBLES) { | 99 if (manager_state_ == SHOW_BUBBLES) { |
95 for (auto controller : show_queue_) | 100 for (auto controller : show_queue_) |
96 controller->Show(); | 101 controller->Show(); |
97 | 102 |
98 controllers_.insert(controllers_.end(), show_queue_.begin(), | 103 controllers_.insert(controllers_.end(), show_queue_.begin(), |
99 show_queue_.end()); | 104 show_queue_.end()); |
100 | 105 |
101 show_queue_.weak_clear(); | 106 show_queue_.weak_clear(); |
102 } else { | 107 } else { |
103 // Clear the queue if bubbles can't be shown. | 108 // Clear the queue if bubbles can't be shown. |
104 show_queue_.clear(); | 109 show_queue_.clear(); |
105 } | 110 } |
106 } | 111 } |
OLD | NEW |