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/user_view.h" | 5 #include "chrome/browser/chromeos/login/user_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "chrome/browser/chromeos/login/helper.h" | 9 #include "chrome/browser/chromeos/login/helper.h" |
10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 10 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 private: | 235 private: |
236 SkBitmap image_; | 236 SkBitmap image_; |
237 SkBitmap image_hot_; | 237 SkBitmap image_hot_; |
238 | 238 |
239 DISALLOW_COPY_AND_ASSIGN(PodImageView); | 239 DISALLOW_COPY_AND_ASSIGN(PodImageView); |
240 }; | 240 }; |
241 | 241 |
242 UserView::UserView(Delegate* delegate, bool is_login, bool need_background) | 242 UserView::UserView(Delegate* delegate, bool is_login, bool need_background) |
243 : delegate_(delegate), | 243 : delegate_(delegate), |
244 signout_view_(NULL), | 244 signout_view_(NULL), |
245 image_view_(new RoundedView<PodImageView>), | 245 image_view_(NULL), |
246 throbber_(CreateDefaultSmoothedThrobber()), | 246 throbber_(CreateDefaultSmoothedThrobber()), |
247 remove_button_(NULL) { | 247 remove_button_(NULL) { |
248 DCHECK(delegate); | 248 DCHECK(delegate); |
249 if (!is_login) | 249 if (!is_login) |
250 signout_view_ = new SignoutView(this); | 250 signout_view_ = new SignoutView(this); |
251 | 251 |
| 252 if (need_background) |
| 253 image_view_ = new RoundedView<PodImageView>; |
| 254 else |
| 255 image_view_ = new PodImageView; |
| 256 |
252 Init(need_background); | 257 Init(need_background); |
253 } | 258 } |
254 | 259 |
255 void UserView::Init(bool need_background) { | 260 void UserView::Init(bool need_background) { |
256 if (need_background) { | 261 if (need_background) { |
257 image_view_->set_background( | 262 image_view_->set_background( |
258 views::Background::CreateSolidBackground(kBackgroundColor)); | 263 views::Background::CreateSolidBackground(kBackgroundColor)); |
259 } | 264 } |
260 if (throbber_) { | 265 if (throbber_) { |
261 int w = throbber_->GetPreferredSize().width(); | 266 int w = throbber_->GetPreferredSize().width(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 DCHECK(delegate_); | 344 DCHECK(delegate_); |
340 if (remove_button_ == sender) | 345 if (remove_button_ == sender) |
341 delegate_->OnRemoveUser(); | 346 delegate_->OnRemoveUser(); |
342 } | 347 } |
343 | 348 |
344 void UserView::OnLocaleChanged() { | 349 void UserView::OnLocaleChanged() { |
345 remove_button_->SetText(l10n_util::GetString(IDS_LOGIN_REMOVE)); | 350 remove_button_->SetText(l10n_util::GetString(IDS_LOGIN_REMOVE)); |
346 } | 351 } |
347 | 352 |
348 } // namespace chromeos | 353 } // namespace chromeos |
OLD | NEW |