Chromium Code Reviews| Index: chrome/browser/ui/views/passwords/credentials_item_view.cc |
| diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.cc b/chrome/browser/ui/views/passwords/credentials_item_view.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..18891d523fcbb6632936e21df64de30105f86b20 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/passwords/credentials_item_view.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
| + |
| +#include "chrome/browser/browser_process.h" |
| +#include "chrome/browser/profiles/profile_avatar_icon_util.h" |
| +#include "chrome/browser/profiles/profile_info_cache.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| +#include "grit/theme_resources.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| +#include "ui/gfx/image/image.h" |
| + |
| +namespace { |
| +const int kButtonHeight = 50; |
| +} |
| + |
| +CredentialsItemView::CredentialsItemView(views::ButtonListener* button_listener, |
| + const base::string16& text) |
| + : LabelButton(button_listener, text) { |
| + SetMinSize(gfx::Size(0, kButtonHeight)); |
| + const ProfileInfoCache& cache = |
| + g_browser_process->profile_manager()->GetProfileInfoCache(); |
| + 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
|
| + SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon( |
| + image, true, kButtonHeight, kButtonHeight).ToImageSkia()); |
| + SetFocusable(true); |
| +} |
| + |
| +CredentialsItemView::~CredentialsItemView() { |
| +} |