| 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/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 rb.GetFontList(ui::ResourceBundle::LargeFont); | 50 rb.GetFontList(ui::ResourceBundle::LargeFont); |
| 51 text_width_ = gfx::GetStringWidth(text_, font_list); | 51 text_width_ = gfx::GetStringWidth(text_, font_list); |
| 52 SetPreferredSize( | 52 SetPreferredSize( |
| 53 gfx::Size(text_width_ + kHorizontalMarginAroundText, | 53 gfx::Size(text_width_ + kHorizontalMarginAroundText, |
| 54 font_list.GetHeight() + kVerticalMarginAroundText)); | 54 font_list.GetHeight() + kVerticalMarginAroundText)); |
| 55 views::Label* label = new views::Label(); | 55 views::Label* label = new views::Label(); |
| 56 label->SetText(text_); | 56 label->SetText(text_); |
| 57 label->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 57 label->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 58 label->SetFontList(font_list); | 58 label->SetFontList(font_list); |
| 59 label->SetEnabledColor(kTextColor); | 59 label->SetEnabledColor(kTextColor); |
| 60 label->SetDisabledColor(kTextColor); | |
| 61 label->SetAutoColorReadabilityEnabled(false); | 60 label->SetAutoColorReadabilityEnabled(false); |
| 62 label->SetSubpixelRenderingEnabled(false); | 61 label->SetSubpixelRenderingEnabled(false); |
| 63 AddChildView(label); | 62 AddChildView(label); |
| 64 SetLayoutManager(new views::FillLayout); | 63 SetLayoutManager(new views::FillLayout); |
| 65 } | 64 } |
| 66 | 65 |
| 67 void OnPaint(gfx::Canvas* canvas) override { | 66 void OnPaint(gfx::Canvas* canvas) override { |
| 68 cc::PaintFlags flags; | 67 cc::PaintFlags flags; |
| 69 flags.setStyle(cc::PaintFlags::kFill_Style); | 68 flags.setStyle(cc::PaintFlags::kFill_Style); |
| 70 flags.setColor(kWindowBackgroundColor); | 69 flags.setColor(kWindowBackgroundColor); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 widget_->Show(); | 159 widget_->Show(); |
| 161 | 160 |
| 162 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 161 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 163 } | 162 } |
| 164 | 163 |
| 165 void ExitWarningHandler::Hide() { | 164 void ExitWarningHandler::Hide() { |
| 166 widget_.reset(); | 165 widget_.reset(); |
| 167 } | 166 } |
| 168 | 167 |
| 169 } // namespace ash | 168 } // namespace ash |
| OLD | NEW |