| 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 #ifndef COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ | 5 #ifndef COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ |
| 6 #define COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ | 6 #define COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Notify a bubble of an event that might trigger close. | 31 // Notify a bubble of an event that might trigger close. |
| 32 // Returns true if the bubble was actually closed. | 32 // Returns true if the bubble was actually closed. |
| 33 bool CloseBubble(BubbleReference bubble, BubbleCloseReason reason); | 33 bool CloseBubble(BubbleReference bubble, BubbleCloseReason reason); |
| 34 | 34 |
| 35 // Notify all bubbles of an event that might trigger close. | 35 // Notify all bubbles of an event that might trigger close. |
| 36 void CloseAllBubbles(BubbleCloseReason reason); | 36 void CloseAllBubbles(BubbleCloseReason reason); |
| 37 | 37 |
| 38 // Notify all bubbles that their anchor or parent may have changed. | 38 // Notify all bubbles that their anchor or parent may have changed. |
| 39 void UpdateAllBubbleAnchors(); | 39 void UpdateAllBubbleAnchors(); |
| 40 | 40 |
| 41 // Notify a bubble that it should update its UI. |
| 42 // Returns true if the UI was updated. |
| 43 bool UpdateBubbleUI(BubbleReference bubble); |
| 44 |
| 41 private: | 45 private: |
| 42 enum ManagerStates { | 46 enum ManagerStates { |
| 43 SHOW_BUBBLES, | 47 SHOW_BUBBLES, |
| 44 QUEUE_BUBBLES, | 48 QUEUE_BUBBLES, |
| 45 NO_MORE_BUBBLES, | 49 NO_MORE_BUBBLES, |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 // Show any bubbles that were added to |show_queue_|. | 52 // Show any bubbles that were added to |show_queue_|. |
| 49 void ShowPendingBubbles(); | 53 void ShowPendingBubbles(); |
| 50 | 54 |
| 51 // Verify that functions that affect the UI are done on the same thread. | 55 // Verify that functions that affect the UI are done on the same thread. |
| 52 base::ThreadChecker thread_checker_; | 56 base::ThreadChecker thread_checker_; |
| 53 | 57 |
| 54 // Determines what happens to a bubble when |ShowBubble| is called. | 58 // Determines what happens to a bubble when |ShowBubble| is called. |
| 55 ManagerStates manager_state_; | 59 ManagerStates manager_state_; |
| 56 | 60 |
| 57 // The bubbles that are being managed. | 61 // The bubbles that are being managed. |
| 58 ScopedVector<BubbleController> controllers_; | 62 ScopedVector<BubbleController> controllers_; |
| 59 | 63 |
| 60 // The bubbles queued to be shown when possible. | 64 // The bubbles queued to be shown when possible. |
| 61 ScopedVector<BubbleController> show_queue_; | 65 ScopedVector<BubbleController> show_queue_; |
| 62 | 66 |
| 63 DISALLOW_COPY_AND_ASSIGN(BubbleManager); | 67 DISALLOW_COPY_AND_ASSIGN(BubbleManager); |
| 64 }; | 68 }; |
| 65 | 69 |
| 66 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ | 70 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ |
| OLD | NEW |