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

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

Issue 733463003: Show user credentials chooser bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/ui/views/passwords/credentials_item_view.h" 5 #include "chrome/browser/ui/views/passwords/credentials_item_view.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile_avatar_icon_util.h" 8 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
9 #include "chrome/browser/profiles/profile_info_cache.h" 9 #include "chrome/browser/profiles/profile_info_cache.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
11 #include "grit/theme_resources.h" 11 #include "grit/theme_resources.h"
12 #include "ui/base/resource/resource_bundle.h" 12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/gfx/image/image.h" 13 #include "ui/gfx/image/image.h"
14 14
15 namespace { 15 namespace {
16 const int kButtonHeight = 50; 16 const int kButtonHeight = 50;
17 } 17 }
18 18
19 CredentialsItemView::CredentialsItemView(views::ButtonListener* button_listener, 19 CredentialsItemView::CredentialsItemView(views::ButtonListener* button_listener,
20 const base::string16& text) 20 const autofill::PasswordForm& form)
21 : LabelButton(button_listener, text) { 21 : LabelButton(button_listener, form.username_value),
22 form_(form) {
22 SetMinSize(gfx::Size(0, kButtonHeight)); 23 SetMinSize(gfx::Size(0, kButtonHeight));
23 // TODO(vasilii): temporary code below shows the built-in profile icon instead 24 // TODO(vasilii): temporary code below shows the built-in profile icon instead
24 // of avatar. 25 // of avatar.
25 const ProfileInfoCache& cache = 26 const ProfileInfoCache& cache =
26 g_browser_process->profile_manager()->GetProfileInfoCache(); 27 g_browser_process->profile_manager()->GetProfileInfoCache();
27 const gfx::Image& image = cache.GetAvatarIconOfProfileAtIndex(0); 28 const gfx::Image& image = cache.GetAvatarIconOfProfileAtIndex(0);
28 SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon( 29 SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon(
29 image, true, kButtonHeight, kButtonHeight).ToImageSkia()); 30 image, true, kButtonHeight, kButtonHeight).ToImageSkia());
30 SetFocusable(true); 31 SetFocusable(true);
31 } 32 }
32 33
33 CredentialsItemView::~CredentialsItemView() { 34 CredentialsItemView::~CredentialsItemView() {
34 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698