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

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

Issue 8142026: Revert 104076 - Change std::wstring to string16 for views::Link (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/new_user_view.h" 5 #include "chrome/browser/chromeos/login/new_user_view.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 void NewUserView::UpdateLocalizedStringsAndFonts() { 284 void NewUserView::UpdateLocalizedStringsAndFonts() {
285 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 285 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
286 gfx::Font title_font = rb.GetFont(ResourceBundle::MediumBoldFont).DeriveFont( 286 gfx::Font title_font = rb.GetFont(ResourceBundle::MediumBoldFont).DeriveFont(
287 kLoginTitleFontDelta); 287 kLoginTitleFontDelta);
288 const gfx::Font& title_hint_font = rb.GetFont(ResourceBundle::BoldFont); 288 const gfx::Font& title_hint_font = rb.GetFont(ResourceBundle::BoldFont);
289 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); 289 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
290 290
291 title_label_->SetFont(title_font); 291 title_label_->SetFont(title_font);
292 title_label_->SetText( 292 title_label_->SetText(UTF16ToWide(
293 l10n_util::GetStringUTF16(IDS_LOGIN_TITLE)); 293 l10n_util::GetStringUTF16(IDS_LOGIN_TITLE)));
294 title_hint_label_->SetFont(title_hint_font); 294 title_hint_label_->SetFont(title_hint_font);
295 title_hint_label_->SetText(l10n_util::GetStringUTF16(IDS_LOGIN_TITLE_HINT)); 295 title_hint_label_->SetText(UTF16ToWide(
296 l10n_util::GetStringUTF16(IDS_LOGIN_TITLE_HINT)));
296 SetAndCorrectTextfieldFont(username_field_, base_font); 297 SetAndCorrectTextfieldFont(username_field_, base_font);
297 username_field_->set_text_to_display_when_empty( 298 username_field_->set_text_to_display_when_empty(
298 l10n_util::GetStringUTF16(IDS_LOGIN_USERNAME)); 299 l10n_util::GetStringUTF16(IDS_LOGIN_USERNAME));
299 SetAndCorrectTextfieldFont(password_field_, base_font); 300 SetAndCorrectTextfieldFont(password_field_, base_font);
300 password_field_->set_text_to_display_when_empty( 301 password_field_->set_text_to_display_when_empty(
301 l10n_util::GetStringUTF16(IDS_LOGIN_PASSWORD)); 302 l10n_util::GetStringUTF16(IDS_LOGIN_PASSWORD));
302 sign_in_button_->SetText(UTF16ToWide( 303 sign_in_button_->SetText(UTF16ToWide(
303 l10n_util::GetStringUTF16(IDS_LOGIN_BUTTON))); 304 l10n_util::GetStringUTF16(IDS_LOGIN_BUTTON)));
304 if (need_guest_link_) { 305 if (need_guest_link_) {
305 guest_link_->SetFont(base_font); 306 guest_link_->SetFont(base_font);
306 guest_link_->SetText( 307 guest_link_->SetText(UTF16ToWide(
307 l10n_util::GetStringUTF16(IDS_BROWSE_WITHOUT_SIGNING_IN_BUTTON)); 308 l10n_util::GetStringUTF16(IDS_BROWSE_WITHOUT_SIGNING_IN_BUTTON)));
308 } 309 }
309 if (need_create_account_) { 310 if (need_create_account_) {
310 create_account_link_->SetFont(base_font); 311 create_account_link_->SetFont(base_font);
311 create_account_link_->SetText( 312 create_account_link_->SetText(
312 l10n_util::GetStringUTF16(IDS_CREATE_ACCOUNT_BUTTON)); 313 UTF16ToWide(l10n_util::GetStringUTF16(IDS_CREATE_ACCOUNT_BUTTON)));
313 } 314 }
314 delegate_->ClearErrors(); 315 delegate_->ClearErrors();
315 languages_menubutton_->SetText( 316 languages_menubutton_->SetText(
316 UTF16ToWide(language_switch_menu_.GetCurrentLocaleName())); 317 UTF16ToWide(language_switch_menu_.GetCurrentLocaleName()));
317 } 318 }
318 319
319 void NewUserView::OnLocaleChanged() { 320 void NewUserView::OnLocaleChanged() {
320 RecreatePeculiarControls(); 321 RecreatePeculiarControls();
321 UpdateLocalizedStringsAndFonts(); 322 UpdateLocalizedStringsAndFonts();
322 AddChildView(sign_in_button_); 323 AddChildView(sign_in_button_);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 height = username_field_->GetPreferredSize().height() + 420 height = username_field_->GetPreferredSize().height() +
420 password_field_->GetPreferredSize().height() + 421 password_field_->GetPreferredSize().height() +
421 sign_in_button_->GetPreferredSize().height() + 422 sign_in_button_->GetPreferredSize().height() +
422 2 * kRowPad; 423 2 * kRowPad;
423 y = title_end + (bottom_start - title_end - height) / 2; 424 y = title_end + (bottom_start - title_end - height) / 2;
424 425
425 y += setViewBounds(username_field_, x, y, width, true) + kRowPad; 426 y += setViewBounds(username_field_, x, y, width, true) + kRowPad;
426 y += setViewBounds(password_field_, x, y, width, true) + kRowPad; 427 y += setViewBounds(password_field_, x, y, width, true) + kRowPad;
427 428
428 int sign_in_button_width = sign_in_button_->GetPreferredSize().width(); 429 int sign_in_button_width = sign_in_button_->GetPreferredSize().width();
429 setViewBounds(sign_in_button_, x, y, sign_in_button_width, true); 430 setViewBounds(sign_in_button_, x, y, sign_in_button_width,true);
430 431
431 SchedulePaint(); 432 SchedulePaint();
432 } 433 }
433 434
434 gfx::Size NewUserView::GetPreferredSize() { 435 gfx::Size NewUserView::GetPreferredSize() {
435 return need_guest_link_ ? 436 return need_guest_link_ ?
436 gfx::Size(kNewUserPodFullWidth, kNewUserPodFullHeight) : 437 gfx::Size(kNewUserPodFullWidth, kNewUserPodFullHeight) :
437 gfx::Size(kNewUserPodSmallWidth, kNewUserPodSmallHeight); 438 gfx::Size(kNewUserPodSmallWidth, kNewUserPodSmallHeight);
438 } 439 }
439 440
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 if (username_field_->text().empty() && 564 if (username_field_->text().empty() &&
564 password_field_->text().empty()) { 565 password_field_->text().empty()) {
565 delegate_->NavigateAway(); 566 delegate_->NavigateAway();
566 return true; 567 return true;
567 } else { 568 } else {
568 return false; 569 return false;
569 } 570 }
570 } 571 }
571 572
572 void NewUserView::InitLink(views::Link** link) { 573 void NewUserView::InitLink(views::Link** link) {
573 *link = new views::Link(string16()); 574 *link = new views::Link(std::wstring());
574 (*link)->set_listener(this); 575 (*link)->set_listener(this);
575 (*link)->SetNormalColor(login::kLinkColor); 576 (*link)->SetNormalColor(login::kLinkColor);
576 (*link)->SetHighlightedColor(login::kLinkColor); 577 (*link)->SetHighlightedColor(login::kLinkColor);
577 AddChildView(*link); 578 AddChildView(*link);
578 } 579 }
579 580
580 } // namespace chromeos 581 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/network_selection_view.cc ('k') | chrome/browser/chromeos/login/password_changed_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698