| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 static int badge_spacing() { | 457 static int badge_spacing() { |
| 458 // The space between the right/bottom edge of the profile badge and the | 458 // The space between the right/bottom edge of the profile badge and the |
| 459 // right/bottom edge of the profile icon. | 459 // right/bottom edge of the profile icon. |
| 460 return switches::IsMaterialDesignUserMenu() ? 4 : 0; | 460 return switches::IsMaterialDesignUserMenu() ? 4 : 0; |
| 461 } | 461 } |
| 462 | 462 |
| 463 bool CanProcessEventsWithinSubtree() const override { return interactive_; } | 463 bool CanProcessEventsWithinSubtree() const override { return interactive_; } |
| 464 | 464 |
| 465 private: | 465 private: |
| 466 // views::CustomButton: | 466 // views::CustomButton: |
| 467 void StateChanged() override { | 467 void StateChanged(ButtonState old_state) override { |
| 468 if (photo_overlay_) { | 468 if (photo_overlay_) { |
| 469 photo_overlay_->SetVisible( | 469 photo_overlay_->SetVisible( |
| 470 state() == STATE_PRESSED || state() == STATE_HOVERED || HasFocus()); | 470 state() == STATE_PRESSED || state() == STATE_HOVERED || HasFocus()); |
| 471 } | 471 } |
| 472 } | 472 } |
| 473 | 473 |
| 474 void OnFocus() override { | 474 void OnFocus() override { |
| 475 views::LabelButton::OnFocus(); | 475 views::LabelButton::OnFocus(); |
| 476 if (photo_overlay_) | 476 if (photo_overlay_) |
| 477 photo_overlay_->SetVisible(true); | 477 photo_overlay_->SetVisible(true); |
| (...skipping 1826 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 |