Chromium Code Reviews| Index: components/bubble/bubble_delegate.h |
| diff --git a/components/bubble/bubble_delegate.h b/components/bubble/bubble_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8987d0645a5ec9e1d943295cdaff02eeb34636d0 |
| --- /dev/null |
| +++ b/components/bubble/bubble_delegate.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ |
| +#define COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +class BubbleUI; |
| + |
| +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.
|
| + public: |
| + BubbleDelegate(); |
| + virtual ~BubbleDelegate(); |
| + |
| + // 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.
|
| + // This is different than hiding the bubble because the delegate will be |
| + // cleaned up after this call. |
| + 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.
|
| + |
| + // Returning true here means that the bubble will not be shown again after it |
| + // is hidden. |
| + 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.
|
| + |
| + // Build UI to represent this bubble. |
| + virtual scoped_ptr<BubbleUI> BuildBubbleUI() = 0; |
| + |
| + // 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.
|
| + // hidden/closed/shown on the correct events. |
| + virtual void* GetContext() const = 0; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(BubbleDelegate); |
| +}; |
| + |
| +#endif // COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_ |