OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_ |
6 #define ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_ | 6 #define ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_ |
7 | 7 |
| 8 #include "ash/ash_export.h" |
8 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" |
10 #include "ui/views/window/dialog_delegate.h" | 12 #include "ui/views/window/dialog_delegate.h" |
11 | 13 |
12 namespace aura { | 14 namespace aura { |
13 class RootWindow; | 15 class RootWindow; |
14 } // namespace aura | 16 } // namespace aura |
15 | 17 |
16 namespace gfx { | 18 namespace gfx { |
17 class Display; | 19 class Display; |
18 class Size; | 20 class Size; |
19 } // namespace gfx | 21 } // namespace gfx |
20 | 22 |
21 namespace views { | 23 namespace views { |
22 class Label; | 24 class Label; |
23 } // namespace views | 25 } // namespace views |
24 | 26 |
25 namespace ash { | 27 namespace ash { |
26 namespace internal { | 28 namespace internal { |
27 | 29 |
28 // Dialog used to show an error messages when unable to change the display | 30 // Dialog used to show an error messages when unable to change the display |
29 // configuration to mirroring. | 31 // configuration to mirroring. |
30 class DisplayErrorDialog : public views::DialogDelegateView, | 32 class ASH_EXPORT DisplayErrorDialog : public views::DialogDelegateView, |
31 public ash::DisplayController::Observer { | 33 public ash::DisplayController::Observer { |
32 public: | 34 public: |
33 // Shows the error dialog. | 35 // Shows the error dialog. |
34 static void ShowDialog(); | 36 static void ShowDialog(); |
35 | 37 |
36 private: | 38 private: |
| 39 FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, Normal); |
| 40 FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, CallTwice); |
| 41 FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, SingleDisplay); |
| 42 FRIEND_TEST_ALL_PREFIXES(DisplayErrorDialogTest, DisplayDisconnected); |
| 43 |
37 DisplayErrorDialog(); | 44 DisplayErrorDialog(); |
38 virtual ~DisplayErrorDialog(); | 45 virtual ~DisplayErrorDialog(); |
39 | 46 |
40 // views::DialogDelegate overrides: | 47 // views::DialogDelegate overrides: |
41 virtual int GetDialogButtons() const OVERRIDE; | 48 virtual int GetDialogButtons() const OVERRIDE; |
42 | 49 |
43 // views::WidgetDelegate overrides:: | 50 // views::WidgetDelegate overrides:: |
44 virtual ui::ModalType GetModalType() const OVERRIDE; | 51 virtual ui::ModalType GetModalType() const OVERRIDE; |
45 | 52 |
46 // views::View overrides: | 53 // views::View overrides: |
47 virtual gfx::Size GetPreferredSize() OVERRIDE; | 54 virtual gfx::Size GetPreferredSize() OVERRIDE; |
48 | 55 |
49 // ash::DisplayController::Observer overrides: | 56 // ash::DisplayController::Observer overrides: |
50 virtual void OnDisplayConfigurationChanging() OVERRIDE; | 57 virtual void OnDisplayConfigurationChanging() OVERRIDE; |
51 | 58 |
| 59 // Returns the pointer of the current instance of this dialog. |
| 60 static DisplayErrorDialog* GetInstanceForTest(); |
| 61 |
52 views::Label* label_; | 62 views::Label* label_; |
53 | 63 |
54 DISALLOW_COPY_AND_ASSIGN(DisplayErrorDialog); | 64 DISALLOW_COPY_AND_ASSIGN(DisplayErrorDialog); |
55 }; | 65 }; |
56 | 66 |
57 } // namespace internal | 67 } // namespace internal |
58 } // namespace ash | 68 } // namespace ash |
59 | 69 |
60 #endif // ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_ | 70 #endif // ASH_DISPLAY_DISPLAY_ERROR_DIALOG_H_ |
OLD | NEW |