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

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

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment per danakj. Created 5 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 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::ClipTransformRecorder clip_transform_recorder(context); 331 ui::ClipTransformRecorder clip_transform_recorder(context, size());
332 clip_transform_recorder.ClipPathWithAntiAliasing(circular_mask_); 332 clip_transform_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 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 1870 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
1871 IncognitoModePrefs::DISABLED; 1871 IncognitoModePrefs::DISABLED;
1872 return incognito_available && !browser_->profile()->IsGuestSession(); 1872 return incognito_available && !browser_->profile()->IsGuestSession();
1873 } 1873 }
1874 1874
1875 void ProfileChooserView::PostActionPerformed( 1875 void ProfileChooserView::PostActionPerformed(
1876 ProfileMetrics::ProfileDesktopMenu action_performed) { 1876 ProfileMetrics::ProfileDesktopMenu action_performed) {
1877 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 1877 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
1878 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 1878 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
1879 } 1879 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698