Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: components/bubble/bubble_manager.h

Issue 1251633002: Add BubbleManager to manage bubbles and ChromeBubbleManager for events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_BUBBLE_BUBBLE_MANAGER_H__
6 #define COMPONENTS_BUBBLE_BUBBLE_MANAGER_H__
7
8 #include "base/memory/scoped_vector.h"
9 #include "base/memory/weak_ptr.h"
10 #include "components/bubble/bubble_controller.h"
11
12 class BubbleDelegate;
13 typedef base::WeakPtr<BubbleDelegate> BubbleReference;
14
15 /**
16 * BubbleManager should exist per profile.
17 * Showing bubbles should go through the BubbleManager.
18 *
19 * This class assumes that we won't be showing a lot of bubbles simultaneously.
20 * If this assumption ever stops being true, please file a bug against whatever
21 * is bombarding the user with many bubbles at the same time.
22 */
23 class BubbleManager {
24 public:
25 virtual ~BubbleManager();
26
27 BubbleReference ShowBubble(scoped_ptr<BubbleDelegate> bubble);
28 void HideBubble(BubbleReference bubble);
29 bool IsBubbleVisible(BubbleReference bubble);
30
31 protected:
32 // This class should be subclassed to hook into all the appropriate events.
33 BubbleManager();
34
35 // For mass updating of bubbles:
36 void ShowMatchingBubbles(void* context);
37 void HideMatchingBubbles(void* context, BubbleCloseReason reason);
38 void UpdateMatchingBubbles(void* context);
39
40 ScopedVector<BubbleController> controllers_;
41 };
hcarmona 2015/08/06 17:43:44 Make sure all files have disallow copy + assign
42
43 #endif // COMPONENTS_BUBBLE_BUBBLE_MANAGER_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698