Chromium Code Reviews| OLD | NEW |
|---|---|
| (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__ | |
| OLD | NEW |