Chromium Code Reviews| 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 const ProfileInfoCache& cache = | |
| 24 g_browser_process->profile_manager()->GetProfileInfoCache(); | |
| 25 const gfx::Image& image = cache.GetAvatarIconOfProfileAtIndex(0); | |
|
Mike West
2014/11/13 10:06:26
Can you add some comment to the effect that this i
vasilii
2014/11/13 12:00:19
I'm not sure what happens in the future. Credentia
| |
| 26 SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon( | |
| 27 image, true, kButtonHeight, kButtonHeight).ToImageSkia()); | |
| 28 SetFocusable(true); | |
| 29 } | |
| 30 | |
| 31 CredentialsItemView::~CredentialsItemView() { | |
| 32 } | |
| OLD | NEW |