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 #include "ash/display/display_error_dialog.h" | 5 #include "ash/display/display_error_dialog.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "grit/ash_strings.h" | 9 #include "grit/ash_strings.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 widget->Show(); | 56 widget->Show(); |
57 } | 57 } |
58 | 58 |
59 DisplayErrorDialog::DisplayErrorDialog() { | 59 DisplayErrorDialog::DisplayErrorDialog() { |
60 Shell::GetInstance()->display_controller()->AddObserver(this); | 60 Shell::GetInstance()->display_controller()->AddObserver(this); |
61 label_ = new views::Label( | 61 label_ = new views::Label( |
62 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING)); | 62 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING)); |
63 AddChildView(label_); | 63 AddChildView(label_); |
64 | 64 |
65 label_->SetMultiLine(true); | 65 label_->SetMultiLine(true); |
66 label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 66 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
67 label_->set_border(views::Border::CreateEmptyBorder( | 67 label_->set_border(views::Border::CreateEmptyBorder( |
68 kDialogMessageMarginWidthPixel, | 68 kDialogMessageMarginWidthPixel, |
69 kDialogMessageMarginWidthPixel, | 69 kDialogMessageMarginWidthPixel, |
70 kDialogMessageMarginWidthPixel, | 70 kDialogMessageMarginWidthPixel, |
71 kDialogMessageMarginWidthPixel)); | 71 kDialogMessageMarginWidthPixel)); |
72 label_->SizeToFit(kDialogMessageWidthPixel); | 72 label_->SizeToFit(kDialogMessageWidthPixel); |
73 } | 73 } |
74 | 74 |
75 DisplayErrorDialog::~DisplayErrorDialog() { | 75 DisplayErrorDialog::~DisplayErrorDialog() { |
76 Shell::GetInstance()->display_controller()->RemoveObserver(this); | 76 Shell::GetInstance()->display_controller()->RemoveObserver(this); |
(...skipping 15 matching lines...) Expand all Loading... |
92 gfx::Size DisplayErrorDialog::GetPreferredSize() { | 92 gfx::Size DisplayErrorDialog::GetPreferredSize() { |
93 return label_->GetPreferredSize(); | 93 return label_->GetPreferredSize(); |
94 } | 94 } |
95 | 95 |
96 void DisplayErrorDialog::OnDisplayConfigurationChanging() { | 96 void DisplayErrorDialog::OnDisplayConfigurationChanging() { |
97 GetWidget()->Close(); | 97 GetWidget()->Close(); |
98 } | 98 } |
99 | 99 |
100 } // namespace internal | 100 } // namespace internal |
101 } // namespace ash | 101 } // namespace ash |
OLD | NEW |