OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/login/update_view.h" | 5 #include "chrome/browser/chromeos/login/update_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Label color. | 45 // Label color. |
46 const SkColor kLabelColor = 0xFF000000; | 46 const SkColor kLabelColor = 0xFF000000; |
47 const SkColor kSkipLabelColor = 0xFFAA0000; | 47 const SkColor kSkipLabelColor = 0xFFAA0000; |
48 const SkColor kManualRebootLabelColor = 0xFFAA0000; | 48 const SkColor kManualRebootLabelColor = 0xFFAA0000; |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 namespace chromeos { | 52 namespace chromeos { |
53 | 53 |
54 UpdateView::UpdateView(chromeos::ScreenObserver* observer) | 54 UpdateView::UpdateView(chromeos::ScreenObserver* observer) |
55 : escape_accelerator_(base::VKEY_ESCAPE, false, false, false), | 55 : escape_accelerator_(app::VKEY_ESCAPE, false, false, false), |
56 installing_updates_label_(NULL), | 56 installing_updates_label_(NULL), |
57 reboot_label_(NULL), | 57 reboot_label_(NULL), |
58 manual_reboot_label_(NULL), | 58 manual_reboot_label_(NULL), |
59 progress_bar_(NULL), | 59 progress_bar_(NULL), |
60 observer_(observer) { | 60 observer_(observer) { |
61 } | 61 } |
62 | 62 |
63 UpdateView::~UpdateView() { | 63 UpdateView::~UpdateView() { |
64 } | 64 } |
65 | 65 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 escape_to_skip_label_->SizeToFit(max_width); | 149 escape_to_skip_label_->SizeToFit(max_width); |
150 escape_to_skip_label_->SetX(right_margin); | 150 escape_to_skip_label_->SetX(right_margin); |
151 escape_to_skip_label_->SetY(kEscapeToSkipLabelY); | 151 escape_to_skip_label_->SetY(kEscapeToSkipLabelY); |
152 #endif | 152 #endif |
153 SchedulePaint(); | 153 SchedulePaint(); |
154 } | 154 } |
155 | 155 |
156 bool UpdateView::AcceleratorPressed(const views::Accelerator& a) { | 156 bool UpdateView::AcceleratorPressed(const views::Accelerator& a) { |
157 #if !defined(OFFICIAL_BUILD) | 157 #if !defined(OFFICIAL_BUILD) |
158 RemoveAccelerator(escape_accelerator_); | 158 RemoveAccelerator(escape_accelerator_); |
159 if (a.GetKeyCode() == base::VKEY_ESCAPE) { | 159 if (a.GetKeyCode() == app::VKEY_ESCAPE) { |
160 if (controller_ != NULL) { | 160 if (controller_ != NULL) { |
161 controller_->CancelUpdate(); | 161 controller_->CancelUpdate(); |
162 } | 162 } |
163 return true; | 163 return true; |
164 } | 164 } |
165 #endif | 165 #endif |
166 return false; | 166 return false; |
167 } | 167 } |
168 | 168 |
169 void UpdateView::InitLabel(views::Label** label) { | 169 void UpdateView::InitLabel(views::Label** label) { |
170 *label = new views::Label(); | 170 *label = new views::Label(); |
171 (*label)->SetColor(kLabelColor); | 171 (*label)->SetColor(kLabelColor); |
172 (*label)->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 172 (*label)->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
173 (*label)->SetMultiLine(true); | 173 (*label)->SetMultiLine(true); |
174 | 174 |
175 ResourceBundle& res_bundle = ResourceBundle::GetSharedInstance(); | 175 ResourceBundle& res_bundle = ResourceBundle::GetSharedInstance(); |
176 gfx::Font label_font = res_bundle.GetFont(ResourceBundle::MediumBoldFont); | 176 gfx::Font label_font = res_bundle.GetFont(ResourceBundle::MediumBoldFont); |
177 (*label)->SetFont(label_font); | 177 (*label)->SetFont(label_font); |
178 | 178 |
179 AddChildView(*label); | 179 AddChildView(*label); |
180 } | 180 } |
181 | 181 |
182 } // namespace chromeos | 182 } // namespace chromeos |
OLD | NEW |