| 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/memory/weak_ptr.h" | |
| 11 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| 12 #include "components/bubble/bubble_close_reason.h" | 11 #include "components/bubble/bubble_close_reason.h" |
| 12 #include "components/bubble/bubble_reference.h" |
| 13 | 13 |
| 14 class BubbleController; | |
| 15 class BubbleDelegate; | 14 class BubbleDelegate; |
| 16 | 15 |
| 17 typedef base::WeakPtr<BubbleController> BubbleReference; | |
| 18 | |
| 19 // Inherit from BubbleManager to show, update, and close bubbles. | 16 // Inherit from BubbleManager to show, update, and close bubbles. |
| 20 // Any class that inherits from BubbleManager should capture any events that | 17 // Any class that inherits from BubbleManager should capture any events that |
| 21 // should dismiss a bubble or update its anchor point. | 18 // should dismiss a bubble or update its anchor point. |
| 22 // This class assumes that we won't be showing a lot of bubbles simultaneously. | 19 // This class assumes that we won't be showing a lot of bubbles simultaneously. |
| 23 // TODO(hcarmona): Handle simultaneous bubbles. http://crbug.com/366937 | 20 // TODO(hcarmona): Handle simultaneous bubbles. http://crbug.com/366937 |
| 24 class BubbleManager { | 21 class BubbleManager { |
| 25 public: | 22 public: |
| 26 // Should be instantiated on the UI thread. | 23 // Should be instantiated on the UI thread. |
| 27 BubbleManager(); | 24 BubbleManager(); |
| 28 virtual ~BubbleManager(); | 25 virtual ~BubbleManager(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // The bubbles that are being managed. | 57 // The bubbles that are being managed. |
| 61 ScopedVector<BubbleController> controllers_; | 58 ScopedVector<BubbleController> controllers_; |
| 62 | 59 |
| 63 // The bubbles queued to be shown when possible. | 60 // The bubbles queued to be shown when possible. |
| 64 ScopedVector<BubbleController> show_queue_; | 61 ScopedVector<BubbleController> show_queue_; |
| 65 | 62 |
| 66 DISALLOW_COPY_AND_ASSIGN(BubbleManager); | 63 DISALLOW_COPY_AND_ASSIGN(BubbleManager); |
| 67 }; | 64 }; |
| 68 | 65 |
| 69 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ | 66 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H_ |
| OLD | NEW |