Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 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. | |
| 4 | |
| 5 #ifndef ASH_POPUP_MESSAGE_H_ | |
| 6 #define ASH_POPUP_MESSAGE_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/string16.h" | |
| 11 #include "ui/gfx/rect.h" | |
| 12 #include "ui/views/bubble/bubble_border.h" | |
| 13 #include "ui/views/bubble/bubble_delegate.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class BubbleDelegateView; | |
| 17 } | |
| 18 | |
| 19 namespace ash { | |
| 20 | |
| 21 // PopupMessage shows a message to the user. Since the user is not able to | |
| 22 // dismiss it, the calling code needs to explictly close and destroy it. | |
| 23 class ASH_EXPORT PopupMessage { | |
| 24 public: | |
| 25 enum IconType { | |
| 26 ICON_WARNING, | |
| 27 ICON_NONE | |
| 28 }; | |
| 29 | |
| 30 // Creates a message pointing towards |anchor| with the requested | |
| 31 // |arrow_orientation|. The message contains an optional |caption| which is | |
| 32 // drawn in bold and an optional |message| together with an optional icon of | |
| 33 // shape |message_type|. If a component in |size_override| is not 0 the value | |
| 34 // is the used as output size. If |arrow_offset| is not 0, the number is the | |
| 35 // arrow offset in pixels from the border. | |
| 36 PopupMessage(const base::string16& caption, | |
|
msw
2013/05/21 01:41:27
Could the GlobalErrorBubble be extended for this u
Mr4D (OOO till 08-26)
2013/05/21 17:26:40
I have never seen that thing being used - even mor
| |
| 37 const base::string16& message, | |
| 38 IconType message_type, | |
| 39 views::View* anchor, | |
| 40 views::BubbleBorder::Arrow arrow, | |
| 41 const gfx::Size& size_override, | |
| 42 int arrow_offset); | |
| 43 // If the message was not explicitly closed before, it closes the message | |
| 44 // without animation. | |
| 45 virtual ~PopupMessage(); | |
| 46 | |
| 47 // Closes the message with a fade out animation. | |
| 48 void Close(); | |
| 49 | |
| 50 private: | |
| 51 class MessageBubble; | |
| 52 | |
| 53 void CancelHidingAnimation(); | |
| 54 | |
| 55 MessageBubble* view_; | |
| 56 views::Widget* widget_; | |
| 57 | |
| 58 // Variables of the construction time. | |
| 59 views::View* anchor_; | |
| 60 base::string16 caption_; | |
| 61 base::string16 message_; | |
| 62 IconType message_type_; | |
| 63 views::BubbleBorder::Arrow arrow_orientation_; | |
| 64 | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(PopupMessage); | |
| 67 }; | |
| 68 | |
| 69 } // namespace ash | |
| 70 | |
| 71 #endif // ASH_POPUP_MESSAGE_H_ | |
| OLD | NEW |