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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 321 } |
322 | 322 |
323 void OnPaint(gfx::Canvas* canvas) override { | 323 void OnPaint(gfx::Canvas* canvas) override { |
324 // Display the profile picture as a circle. | 324 // Display the profile picture as a circle. |
325 canvas->ClipPath(circular_mask_, true); | 325 canvas->ClipPath(circular_mask_, true); |
326 views::LabelButton::OnPaint(canvas); | 326 views::LabelButton::OnPaint(canvas); |
327 } | 327 } |
328 | 328 |
329 void PaintChildren(const ui::PaintContext& context) override { | 329 void PaintChildren(const ui::PaintContext& context) override { |
330 // Display any children (the "change photo" overlay) as a circle. | 330 // Display any children (the "change photo" overlay) as a circle. |
331 ui::ClipRecorder clip_recorder(context); | 331 ui::ClipRecorder clip_recorder(context, size()); |
332 clip_recorder.ClipPathWithAntiAliasing(circular_mask_); | 332 clip_recorder.ClipPathWithAntiAliasing(circular_mask_); |
333 View::PaintChildren(context); | 333 View::PaintChildren(context); |
334 } | 334 } |
335 | 335 |
336 private: | 336 private: |
337 // views::CustomButton: | 337 // views::CustomButton: |
338 void StateChanged() override { | 338 void StateChanged() override { |
339 bool show_overlay = | 339 bool show_overlay = |
340 (state() == STATE_PRESSED || state() == STATE_HOVERED || HasFocus()); | 340 (state() == STATE_PRESSED || state() == STATE_HOVERED || HasFocus()); |
341 if (photo_overlay_) | 341 if (photo_overlay_) |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1877 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1878 IncognitoModePrefs::DISABLED; | 1878 IncognitoModePrefs::DISABLED; |
1879 return incognito_available && !browser_->profile()->IsGuestSession(); | 1879 return incognito_available && !browser_->profile()->IsGuestSession(); |
1880 } | 1880 } |
1881 | 1881 |
1882 void ProfileChooserView::PostActionPerformed( | 1882 void ProfileChooserView::PostActionPerformed( |
1883 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1883 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1884 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1884 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1885 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1885 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1886 } | 1886 } |
OLD | NEW |