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

Side by Side Diff: chrome/browser/ui/views/passwords/credentials_item_view.cc

Issue 720573003: New credential chooser bubble view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: alignment Created 6 years, 1 month 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
OLDNEW
(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 // Temporary code below shows the built-in profile icon instead of avatar.
Mike West 2014/11/14 10:15:14 Nit: TODO(vasilii)
vasilii 2014/11/14 11:01:54 Done.
24 const ProfileInfoCache& cache =
25 g_browser_process->profile_manager()->GetProfileInfoCache();
26 const gfx::Image& image = cache.GetAvatarIconOfProfileAtIndex(0);
27 SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon(
28 image, true, kButtonHeight, kButtonHeight).ToImageSkia());
29 SetFocusable(true);
30 }
31
32 CredentialsItemView::~CredentialsItemView() {
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698