Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: chrome/browser/chromeos/login/update_view.cc

Issue 8113031: Change std::wstring to string16 for views::Label and views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // Curtain view. 95 // Curtain view.
96 InitLabel(&checking_label_); 96 InitLabel(&checking_label_);
97 throbber_ = CreateDefaultThrobber(); 97 throbber_ = CreateDefaultThrobber();
98 AddChildView(throbber_); 98 AddChildView(throbber_);
99 99
100 #if !defined(OFFICIAL_BUILD) 100 #if !defined(OFFICIAL_BUILD)
101 InitLabel(&escape_to_skip_label_); 101 InitLabel(&escape_to_skip_label_);
102 escape_to_skip_label_->SetColor(kSkipLabelColor); 102 escape_to_skip_label_->SetColor(kSkipLabelColor);
103 escape_to_skip_label_->SetText( 103 escape_to_skip_label_->SetText(
104 L"Press ESCAPE to skip (Non-official builds only)"); 104 ASCIIToUTF16("Press ESCAPE to skip (Non-official builds only)"));
105 #endif 105 #endif
106 106
107 UpdateLocalizedStrings(); 107 UpdateLocalizedStrings();
108 UpdateVisibility(); 108 UpdateVisibility();
109 } 109 }
110 110
111 void UpdateView::Reset() { 111 void UpdateView::Reset() {
112 progress_bar_->SetValue(0.0); 112 progress_bar_->SetValue(0.0);
113 } 113 }
114 114
115 void UpdateView::UpdateLocalizedStrings() { 115 void UpdateView::UpdateLocalizedStrings() {
116 installing_updates_label_->SetText(UTF16ToWide(l10n_util::GetStringFUTF16( 116 installing_updates_label_->SetText(l10n_util::GetStringFUTF16(
117 IDS_INSTALLING_UPDATE, 117 IDS_INSTALLING_UPDATE,
118 l10n_util::GetStringUTF16(IDS_PRODUCT_OS_NAME)))); 118 l10n_util::GetStringUTF16(IDS_PRODUCT_OS_NAME)));
119 preparing_updates_label_->SetText( 119 preparing_updates_label_->SetText(
120 UTF16ToWide(l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE))); 120 l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE));
121 reboot_label_->SetText( 121 reboot_label_->SetText(
122 UTF16ToWide(l10n_util::GetStringUTF16(IDS_INSTALLING_UPDATE_DESC))); 122 l10n_util::GetStringUTF16(IDS_INSTALLING_UPDATE_DESC));
123 manual_reboot_label_->SetText( 123 manual_reboot_label_->SetText(
124 UTF16ToWide(l10n_util::GetStringUTF16(IDS_UPDATE_COMPLETED))); 124 l10n_util::GetStringUTF16(IDS_UPDATE_COMPLETED));
125 checking_label_->SetText( 125 checking_label_->SetText(
126 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CHECKING_FOR_UPDATES))); 126 l10n_util::GetStringUTF16(IDS_CHECKING_FOR_UPDATES));
127 } 127 }
128 128
129 void UpdateView::AddProgress(int ticks) { 129 void UpdateView::AddProgress(int ticks) {
130 progress_bar_->SetValue( 130 progress_bar_->SetValue(
131 max(progress_bar_->current_value() + ticks, 100.0)); 131 max(progress_bar_->current_value() + ticks, 100.0));
132 } 132 }
133 133
134 void UpdateView::SetProgress(int progress) { 134 void UpdateView::SetProgress(int progress) {
135 progress_bar_->SetValue(progress); 135 progress_bar_->SetValue(progress);
136 } 136 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } else if (manual_reboot_label_->IsVisible()) { 253 } else if (manual_reboot_label_->IsVisible()) {
254 label_spoken = manual_reboot_label_; 254 label_spoken = manual_reboot_label_;
255 } else if (preparing_updates_label_->IsVisible()) { 255 } else if (preparing_updates_label_->IsVisible()) {
256 label_spoken = preparing_updates_label_; 256 label_spoken = preparing_updates_label_;
257 } else if (installing_updates_label_->IsVisible()) { 257 } else if (installing_updates_label_->IsVisible()) {
258 label_spoken = installing_updates_label_; 258 label_spoken = installing_updates_label_;
259 } else { 259 } else {
260 NOTREACHED(); 260 NOTREACHED();
261 } 261 }
262 const std::string text = 262 const std::string text =
263 label_spoken ? WideToUTF8(label_spoken->GetText()) : std::string(); 263 label_spoken ? UTF16ToUTF8(label_spoken->GetText()) : std::string();
264 WizardAccessibilityHelper::GetInstance()->MaybeSpeak(text.c_str(), false, 264 WizardAccessibilityHelper::GetInstance()->MaybeSpeak(text.c_str(), false,
265 true); 265 true);
266 } 266 }
267 267
268 } // namespace chromeos 268 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/take_photo_view.cc ('k') | chrome/browser/chromeos/login/user_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698