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

Side by Side Diff: chrome/browser/chromeos/login/user_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/user_view.h" 5 #include "chrome/browser/chromeos/login/user_view.h"
6 6
7 #include <algorithm>
8
7 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/chromeos/login/helper.h" 10 #include "chrome/browser/chromeos/login/helper.h"
9 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" 11 #include "chrome/browser/chromeos/login/rounded_rect_painter.h"
10 #include "chrome/browser/chromeos/view_ids.h" 12 #include "chrome/browser/chromeos/view_ids.h"
11 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
12 #include "grit/theme_resources_standard.h" 14 #include "grit/theme_resources_standard.h"
13 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/gfx/canvas.h" 17 #include "ui/gfx/canvas.h"
16 #include "ui/gfx/canvas_skia.h" 18 #include "ui/gfx/canvas_skia.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 using login::kUserImageSize; 67 using login::kUserImageSize;
66 68
67 // The view that shows the Sign out button below the user's image. 69 // The view that shows the Sign out button below the user's image.
68 class SignoutView : public views::View { 70 class SignoutView : public views::View {
69 public: 71 public:
70 explicit SignoutView(views::LinkListener* link_listener) { 72 explicit SignoutView(views::LinkListener* link_listener) {
71 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 73 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
72 const gfx::Font& font = rb.GetFont(ResourceBundle::SmallFont); 74 const gfx::Font& font = rb.GetFont(ResourceBundle::SmallFont);
73 75
74 active_user_label_ = new views::Label( 76 active_user_label_ = new views::Label(
75 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SCREEN_LOCK_ACTIVE_USER))); 77 l10n_util::GetStringUTF16(IDS_SCREEN_LOCK_ACTIVE_USER));
76 active_user_label_->SetFont(font); 78 active_user_label_->SetFont(font);
77 active_user_label_->SetColor(kTextColor); 79 active_user_label_->SetColor(kTextColor);
78 80
79 signout_link_ = new views::Link( 81 signout_link_ = new views::Link(
80 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SCREEN_LOCK_SIGN_OUT))); 82 l10n_util::GetStringUTF16(IDS_SCREEN_LOCK_SIGN_OUT));
81 signout_link_->set_listener(link_listener); 83 signout_link_->set_listener(link_listener);
82 signout_link_->SetFont(font); 84 signout_link_->SetFont(font);
83 signout_link_->SetColor(kTextColor); 85 signout_link_->SetColor(kTextColor);
84 signout_link_->set_focusable(true); 86 signout_link_->set_focusable(true);
85 signout_link_->SetHighlightedColor(kTextColor); 87 signout_link_->SetHighlightedColor(kTextColor);
86 signout_link_->SetDisabledColor(kTextColor); 88 signout_link_->SetDisabledColor(kTextColor);
87 signout_link_->SetNormalColor(kTextColor); 89 signout_link_->SetNormalColor(kTextColor);
88 signout_link_->set_id(VIEW_ID_SCREEN_LOCKER_SIGNOUT_LINK); 90 signout_link_->set_id(VIEW_ID_SCREEN_LOCKER_SIGNOUT_LINK);
89 91
90 AddChildView(active_user_label_); 92 AddChildView(active_user_label_);
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 delegate_->OnRemoveUser(); 335 delegate_->OnRemoveUser();
334 } 336 }
335 337
336 void UserView::OnLocaleChanged() { 338 void UserView::OnLocaleChanged() {
337 remove_button_->SetText( 339 remove_button_->SetText(
338 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOGIN_REMOVE))); 340 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOGIN_REMOVE)));
339 delegate_->OnLocaleChanged(); 341 delegate_->OnLocaleChanged();
340 } 342 }
341 343
342 } // namespace chromeos 344 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_image_view.cc ('k') | chrome/browser/chromeos/login/username_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698