| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 icon_image_side() + badge_spacing() - GetProfileBadgeSize(); | 406 icon_image_side() + badge_spacing() - GetProfileBadgeSize(); |
| 407 gfx::Vector2d badge_offset_vector = gfx::Vector2d( | 407 gfx::Vector2d badge_offset_vector = gfx::Vector2d( |
| 408 GetMirroredXWithWidthInView(badge_offset, GetProfileBadgeSize()), | 408 GetMirroredXWithWidthInView(badge_offset, GetProfileBadgeSize()), |
| 409 badge_offset + (switches::IsMaterialDesignUserMenu() | 409 badge_offset + (switches::IsMaterialDesignUserMenu() |
| 410 ? views::kRelatedControlSmallVerticalSpacing | 410 ? views::kRelatedControlSmallVerticalSpacing |
| 411 : 0)); | 411 : 0)); |
| 412 | 412 |
| 413 gfx::Point center_point = bounds.CenterPoint() + badge_offset_vector; | 413 gfx::Point center_point = bounds.CenterPoint() + badge_offset_vector; |
| 414 | 414 |
| 415 // Paint the circular background. | 415 // Paint the circular background. |
| 416 SkPaint paint; | 416 cc::PaintFlags paint; |
| 417 paint.setAntiAlias(true); | 417 paint.setAntiAlias(true); |
| 418 paint.setColor(GetNativeTheme()->GetSystemColor( | 418 paint.setColor(GetNativeTheme()->GetSystemColor( |
| 419 ui::NativeTheme::kColorId_BubbleBackground)); | 419 ui::NativeTheme::kColorId_BubbleBackground)); |
| 420 canvas->DrawCircle(center_point, GetProfileBadgeSize() / 2, paint); | 420 canvas->DrawCircle(center_point, GetProfileBadgeSize() / 2, paint); |
| 421 | 421 |
| 422 gfx::VectorIconId icon_id; | 422 gfx::VectorIconId icon_id; |
| 423 int icon_size; | 423 int icon_size; |
| 424 SkColor icon_color; | 424 SkColor icon_color; |
| 425 if (switches::IsMaterialDesignUserMenu()) { | 425 if (switches::IsMaterialDesignUserMenu()) { |
| 426 icon_id = profile_->IsChild() | 426 icon_id = profile_->IsChild() |
| (...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2304 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2304 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 2305 IncognitoModePrefs::DISABLED; | 2305 IncognitoModePrefs::DISABLED; |
| 2306 return incognito_available && !browser_->profile()->IsGuestSession(); | 2306 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 2307 } | 2307 } |
| 2308 | 2308 |
| 2309 void ProfileChooserView::PostActionPerformed( | 2309 void ProfileChooserView::PostActionPerformed( |
| 2310 ProfileMetrics::ProfileDesktopMenu action_performed) { | 2310 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 2311 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 2311 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 2312 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 2312 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 2313 } | 2313 } |
| OLD | NEW |