OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" |
9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/login/helper.h" | 11 #include "chrome/browser/chromeos/login/helper.h" |
11 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 12 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
12 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 13 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
13 #include "grit/chromium_strings.h" | 14 #include "grit/chromium_strings.h" |
14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
17 #include "views/border.h" | 18 #include "views/border.h" |
18 #include "views/controls/label.h" | 19 #include "views/controls/label.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 manual_reboot_label_->SetVisible(!show_curtain_ && show_manual_reboot_label_); | 234 manual_reboot_label_->SetVisible(!show_curtain_ && show_manual_reboot_label_); |
234 progress_bar_->SetVisible(!show_curtain_); | 235 progress_bar_->SetVisible(!show_curtain_); |
235 | 236 |
236 checking_label_->SetVisible(show_curtain_); | 237 checking_label_->SetVisible(show_curtain_); |
237 throbber_->SetVisible(show_curtain_); | 238 throbber_->SetVisible(show_curtain_); |
238 if (show_curtain_) { | 239 if (show_curtain_) { |
239 throbber_->Start(); | 240 throbber_->Start(); |
240 } else { | 241 } else { |
241 throbber_->Stop(); | 242 throbber_->Stop(); |
242 } | 243 } |
| 244 |
| 245 // Speak the shown label when accessibility is enabled. |
| 246 const Label* label_spoken(NULL); |
| 247 if (checking_label_->IsVisible()) { |
| 248 label_spoken = checking_label_; |
| 249 } else if (manual_reboot_label_->IsVisible()) { |
| 250 label_spoken = manual_reboot_label_; |
| 251 } else if (preparing_updates_label_->IsVisible()) { |
| 252 label_spoken = preparing_updates_label_; |
| 253 } else if (installing_updates_label_->IsVisible()) { |
| 254 label_spoken = installing_updates_label_; |
| 255 } else { |
| 256 NOTREACHED(); |
| 257 } |
| 258 const std::string text = |
| 259 label_spoken ? WideToUTF8(label_spoken->GetText()) : std::string(); |
| 260 WizardAccessibilityHelper::GetInstance()->MaybeSpeak(text.c_str(), false, |
| 261 true); |
243 } | 262 } |
244 | 263 |
245 } // namespace chromeos | 264 } // namespace chromeos |
OLD | NEW |