Infobar material design refresh: bg color
[chromium-blink-merge.git] / components / bubble / bubble_delegate.h
blobebac50f33a3d5a4a56b7836d5acf225cfe9675b0
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.
5 #ifndef COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
6 #define COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/bubble/bubble_close_reason.h"
11 class BubbleUI;
13 // Inherit from this class to define a bubble. A bubble is a small transient UI
14 // surface anchored to a parent window. Most bubbles are dismissed when they
15 // lose focus.
16 class BubbleDelegate {
17 public:
18 BubbleDelegate();
19 virtual ~BubbleDelegate();
21 // Called by BubbleController to notify a bubble of an event that the bubble
22 // might want to close on. Return true if the bubble should close for the
23 // specified reason.
24 virtual bool ShouldClose(BubbleCloseReason reason);
26 // Called by BubbleController to build the UI that will represent this bubble.
27 // BubbleDelegate should not keep a reference to this newly created UI.
28 virtual scoped_ptr<BubbleUI> BuildBubbleUI() = 0;
30 private:
31 DISALLOW_COPY_AND_ASSIGN(BubbleDelegate);
34 #endif // COMPONENTS_BUBBLE_BUBBLE_DELEGATE_H_