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

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

Issue 2713993005: Clean up ImageView. (Closed)
Patch Set: revert errant changes Created 3 years, 10 months 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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 form_(form), 69 form_(form),
70 upper_label_(nullptr), 70 upper_label_(nullptr),
71 lower_label_(nullptr), 71 lower_label_(nullptr),
72 info_icon_(nullptr), 72 info_icon_(nullptr),
73 hover_color_(hover_color), 73 hover_color_(hover_color),
74 weak_ptr_factory_(this) { 74 weak_ptr_factory_(this) {
75 set_notify_enter_exit_on_child(true); 75 set_notify_enter_exit_on_child(true);
76 // Create an image-view for the avatar. Make sure it ignores events so that 76 // Create an image-view for the avatar. Make sure it ignores events so that
77 // the parent can receive the events instead. 77 // the parent can receive the events instead.
78 image_view_ = new CircularImageView; 78 image_view_ = new CircularImageView;
79 image_view_->set_interactive(false); 79 image_view_->set_can_process_events_within_subtree(false);
80 gfx::Image image = ResourceBundle::GetSharedInstance().GetImageNamed( 80 gfx::Image image = ResourceBundle::GetSharedInstance().GetImageNamed(
81 IDR_PROFILE_AVATAR_PLACEHOLDER_LARGE); 81 IDR_PROFILE_AVATAR_PLACEHOLDER_LARGE);
82 DCHECK(image.Width() >= kAvatarImageSize && 82 DCHECK(image.Width() >= kAvatarImageSize &&
83 image.Height() >= kAvatarImageSize); 83 image.Height() >= kAvatarImageSize);
84 UpdateAvatar(image.AsImageSkia()); 84 UpdateAvatar(image.AsImageSkia());
85 if (form_->icon_url.is_valid()) { 85 if (form_->icon_url.is_valid()) {
86 // Fetch the actual avatar. 86 // Fetch the actual avatar.
87 AccountAvatarFetcher* fetcher = new AccountAvatarFetcher( 87 AccountAvatarFetcher* fetcher = new AccountAvatarFetcher(
88 form_->icon_url, weak_ptr_factory_.GetWeakPtr()); 88 form_->icon_url, weak_ptr_factory_.GetWeakPtr());
89 fetcher->Start(request_context); 89 fetcher->Start(request_context);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 child_area.CenterPoint().y() - info_icon_->height() / 2)); 187 child_area.CenterPoint().y() - info_icon_->height() / 2));
188 } 188 }
189 } 189 }
190 190
191 void CredentialsItemView::OnPaint(gfx::Canvas* canvas) { 191 void CredentialsItemView::OnPaint(gfx::Canvas* canvas) {
192 if (state() == STATE_PRESSED || state() == STATE_HOVERED) 192 if (state() == STATE_PRESSED || state() == STATE_HOVERED)
193 canvas->DrawColor(hover_color_); 193 canvas->DrawColor(hover_color_);
194 194
195 CustomButton::OnPaint(canvas); 195 CustomButton::OnPaint(canvas);
196 } 196 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698