| OLD | NEW |
| 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 Loading... |
| 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::VectorIconId::PHOTO_CAMERA, |
| 240 GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_CAMERA)); | 240 SkColorSetRGB(0x33, 0x33, 0x33), |
| 241 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 Loading... |
| 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 } |
| OLD | NEW |