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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 1214693005: Introduce some util code for drawing vector assets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 5 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/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/lifetime/application_lifetime.h" 10 #include "chrome/browser/lifetime/application_lifetime.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 229 }
230 230
231 set_notify_enter_exit_on_child(true); 231 set_notify_enter_exit_on_child(true);
232 232
233 // Photo overlay that appears when hovering over the button. 233 // Photo overlay that appears when hovering over the button.
234 photo_overlay_ = new views::ImageView(); 234 photo_overlay_ = new views::ImageView();
235 235
236 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255); 236 const SkColor kBackgroundColor = SkColorSetARGB(65, 255, 255, 255);
237 photo_overlay_->set_background( 237 photo_overlay_->set_background(
238 views::Background::CreateSolidBackground(kBackgroundColor)); 238 views::Background::CreateSolidBackground(kBackgroundColor));
239 photo_overlay_->SetImage(*ui::ResourceBundle::GetSharedInstance(). 239 photo_overlay_->SetVectorIcon(gfx::PHOTO_CAMERA,
240 GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_CAMERA)); 240 SkColorSetRGB(0x33, 0x33, 0x33));
241 photo_overlay_->SetImageSize(gfx::Size(48, 48));
241 242
242 photo_overlay_->SetSize(bounds.size()); 243 photo_overlay_->SetSize(bounds.size());
243 photo_overlay_->SetVisible(false); 244 photo_overlay_->SetVisible(false);
244 AddChildView(photo_overlay_); 245 AddChildView(photo_overlay_);
245 } 246 }
246 247
247 void OnPaint(gfx::Canvas* canvas) override { 248 void OnPaint(gfx::Canvas* canvas) override {
248 // Display the profile picture as a circle. 249 // Display the profile picture as a circle.
249 canvas->ClipPath(circular_mask_, true); 250 canvas->ClipPath(circular_mask_, true);
250 views::LabelButton::OnPaint(canvas); 251 views::LabelButton::OnPaint(canvas);
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1744 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1744 IncognitoModePrefs::DISABLED; 1745 IncognitoModePrefs::DISABLED;
1745 return incognito_available && !browser_->profile()->IsGuestSession(); 1746 return incognito_available && !browser_->profile()->IsGuestSession();
1746 } 1747 }
1747 1748
1748 void ProfileChooserView::PostActionPerformed( 1749 void ProfileChooserView::PostActionPerformed(
1749 ProfileMetrics::ProfileDesktopMenu action_performed) { 1750 ProfileMetrics::ProfileDesktopMenu action_performed) {
1750 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1751 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1751 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1752 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1752 } 1753 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698