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

Unified 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 side-by-side diff with in-line comments
Download patch
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..bdb07ad829052c0de048fdc77ff4300427254a32
--- /dev/null
+++ b/chrome/browser/ui/views/passwords/credentials_item_view.cc
@@ -0,0 +1,33 @@
+// 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));
+ // 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.
+ const ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ const gfx::Image& image = cache.GetAvatarIconOfProfileAtIndex(0);
+ SetImage(STATE_NORMAL, *profiles::GetSizedAvatarIcon(
+ image, true, kButtonHeight, kButtonHeight).ToImageSkia());
+ SetFocusable(true);
+}
+
+CredentialsItemView::~CredentialsItemView() {
+}

Powered by Google App Engine
This is Rietveld 408576698