| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
| 6 |
| 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| 9 #include "chrome/browser/profiles/profile_info_cache.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" |
| 11 #include "grit/theme_resources.h" |
| 12 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/gfx/image/image.h" |
| 14 |
| 15 namespace { |
| 16 const int kButtonHeight = 50; |
| 17 } |
| 18 |
| 19 CredentialsItemView::CredentialsItemView(views::ButtonListener* button_listener, |
| 20 const base::string16& text) |
| 21 : LabelButton(button_listener, text) { |
| 22 SetMinSize(gfx::Size(0, kButtonHeight)); |
| 23 // TODO(vasilii): temporary code below shows the built-in profile icon instead |
| 24 // of avatar. |
| 25 const ProfileInfoCache& cache = |
| 26 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 27 const gfx::Image& image = cache.GetAvatarIconOfProfileAtIndex(0); |
| 28 SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon( |
| 29 image, true, kButtonHeight, kButtonHeight).ToImageSkia()); |
| 30 SetFocusable(true); |
| 31 } |
| 32 |
| 33 CredentialsItemView::~CredentialsItemView() { |
| 34 } |
| OLD | NEW |