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

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: Fix clip recorder params in omnibox. Created 5 years 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::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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc ('k') | chrome/browser/ui/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698