1 // Copyright 2013 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 ASH_POPUP_MESSAGE_H_
6 #define ASH_POPUP_MESSAGE_H_
8 #include "ash/ash_export.h"
9 #include "base/basictypes.h"
10 #include "base/strings/string16.h"
11 #include "ui/gfx/rect.h"
12 #include "ui/views/bubble/bubble_border.h"
15 class BubbleDelegateView
;
20 // PopupMessage shows a message to the user. Since the user is not able to
21 // dismiss it, the calling code needs to explictly close and destroy it.
22 class ASH_EXPORT PopupMessage
{
29 // Creates a message pointing towards |anchor| with the requested
30 // |arrow_orientation|. The message contains an optional |caption| which is
31 // drawn in bold and an optional |message| together with an optional icon of
32 // shape |message_type|. If a component in |size_override| is not 0 the value
33 // is the used as output size. If |arrow_offset| is not 0, the number is the
34 // arrow offset in pixels from the border.
36 // Here is the layout (arrow given as TOP_LEFT):
41 // +-------------------------------------------------+
43 // icon | [!] Caption in bold which can be multi line | caption_label
45 // | Message text which can be multi line | message_label
48 // +-------------------------------------------------+
49 PopupMessage(const base::string16
& caption
,
50 const base::string16
& message
,
51 IconType message_type
,
53 views::BubbleBorder::Arrow arrow
,
54 const gfx::Size
& size_override
,
56 // If the message was not explicitly closed before, it closes the message
58 virtual ~PopupMessage();
60 // Closes the message with a fade out animation.
66 void CancelHidingAnimation();
69 views::Widget
* widget_
;
71 // Variables of the construction time.
73 base::string16 caption_
;
74 base::string16 message_
;
75 IconType message_type_
;
76 views::BubbleBorder::Arrow arrow_orientation_
;
78 DISALLOW_COPY_AND_ASSIGN(PopupMessage
);
83 #endif // ASH_POPUP_MESSAGE_H_