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_DELEGATE_H_ | |
| 6 #define COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 | |
| 10 class BubbleUI; | |
| 11 | |
| 12 class BubbleDelegate { | |
|
msw
2015/08/13 03:37:22
nit: explanatory class comment for the ignorant; w
hcarmona
2015/08/15 02:03:19
Done.
| |
| 13 public: | |
| 14 BubbleDelegate(); | |
| 15 virtual ~BubbleDelegate(); | |
| 16 | |
| 17 // Called to notify the delegate that it is closed. | |
|
msw
2015/08/13 03:37:22
nit: "Called by the BubbleController to"...
hcarmona
2015/08/15 02:03:20
Done.
| |
| 18 // This is different than hiding the bubble because the delegate will be | |
| 19 // cleaned up after this call. | |
| 20 virtual void DidClose() = 0; | |
|
msw
2015/08/13 03:37:22
The controller owns the delegate, right? so why ca
hcarmona
2015/08/15 02:03:20
Done.
| |
| 21 | |
| 22 // Returning true here means that the bubble will not be shown again after it | |
| 23 // is hidden. | |
| 24 virtual bool ShouldCloseOnHide() const = 0; | |
|
msw
2015/08/13 03:37:22
nit: ShouldDestroyOnHide here and elsewhere?
hcarmona
2015/08/15 02:03:20
Acknowledged.
| |
| 25 | |
| 26 // Build UI to represent this bubble. | |
| 27 virtual scoped_ptr<BubbleUI> BuildBubbleUI() = 0; | |
| 28 | |
| 29 // Get the context for this bubble. This allows a bubble to be | |
|
msw
2015/08/13 03:37:22
nit: explain what the context is, maybe give an ex
hcarmona
2015/08/15 02:03:20
Acknowledged.
| |
| 30 // hidden/closed/shown on the correct events. | |
| 31 virtual void* GetContext() const = 0; | |
| 32 | |
| 33 private: | |
| 34 DISALLOW_COPY_AND_ASSIGN(BubbleDelegate); | |
| 35 }; | |
| 36 | |
| 37 #endif // COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ | |
| OLD | NEW |