OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/accelerators/exit_warning_handler.h" | 5 #include "ash/accelerators/exit_warning_handler.h" |
6 | 6 |
7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 label->SetText(text_); | 81 label->SetText(text_); |
82 label->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 82 label->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
83 label->SetFontList(font_list); | 83 label->SetFontList(font_list); |
84 label->SetEnabledColor(kTextColor); | 84 label->SetEnabledColor(kTextColor); |
85 label->SetDisabledColor(kTextColor); | 85 label->SetDisabledColor(kTextColor); |
86 label->SetAutoColorReadabilityEnabled(false); | 86 label->SetAutoColorReadabilityEnabled(false); |
87 AddChildView(label); | 87 AddChildView(label); |
88 SetLayoutManager(new views::FillLayout); | 88 SetLayoutManager(new views::FillLayout); |
89 } | 89 } |
90 | 90 |
91 virtual gfx::Size GetPreferredSize() OVERRIDE { | 91 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
92 return gfx::Size(width_, height_); | 92 return gfx::Size(width_, height_); |
93 } | 93 } |
94 | 94 |
95 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 95 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
96 SkPaint paint; | 96 SkPaint paint; |
97 paint.setStyle(SkPaint::kFill_Style); | 97 paint.setStyle(SkPaint::kFill_Style); |
98 paint.setColor(kWindowBackgroundColor); | 98 paint.setColor(kWindowBackgroundColor); |
99 canvas->DrawRoundRect(GetLocalBounds(), kWindowCornerRadius, paint); | 99 canvas->DrawRoundRect(GetLocalBounds(), kWindowCornerRadius, paint); |
100 views::WidgetDelegateView::OnPaint(canvas); | 100 views::WidgetDelegateView::OnPaint(canvas); |
101 } | 101 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 widget_->Show(); | 200 widget_->Show(); |
201 | 201 |
202 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 202 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
203 } | 203 } |
204 | 204 |
205 void ExitWarningHandler::Hide() { | 205 void ExitWarningHandler::Hide() { |
206 widget_.reset(); | 206 widget_.reset(); |
207 } | 207 } |
208 | 208 |
209 } // namespace ash | 209 } // namespace ash |
OLD | NEW |