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

Side by Side Diff: components/bubble/bubble_controller.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: Kill views_bubble_controller Created 5 years, 5 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_CONTROLLER_H__
6 #define COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H__
7
8 #include "base/callback.h"
9
10 class BubbleDelegate;
11 class BubbleManager;
12
13 enum BubbleCloseReason {
please use gerrit instead 2015/07/22 23:56:09 Add comment that this is for manager metrics.
14 // Bubble was closed without any user interaction.
15 BUBBLE_CLOSE_IGNORE = 0,
16
17 // User did not interact with the bubble, but changed tab.
18 BUBBLE_CLOSE_TABSWITCH,
19
20 // User dismissed the bubble. (ESC, close, etc)
21 BUBBLE_CLOSE_CLOSE,
22
23 // User selected the "Allow" option in a bubble.
24 BUBBLE_CLOSE_ALLOW,
25
26 // User selected the "Deny" option in a bubble.
27 BUBBLE_CLOSE_DENY,
28 };
29
30 class BubbleController {
31 public:
32 BubbleController(BubbleManager* manager, BubbleDelegate* delegate);
33 virtual ~BubbleController();
34
35 virtual void Show();
36 virtual void Hide(BubbleCloseReason reason);
37
38 virtual void UpdatePosition();
39
40 bool IsOwnerOf(BubbleDelegate* delegate) { return delegate == delegate_; }
41
42 private:
43 // Weak.
44 BubbleManager* manager_;
45
46 // Weak.
47 BubbleDelegate* delegate_;
48 };
49
50 #endif // COMPONENTS_BUBBLE_BUBBLE_CONTROLLER_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698