Chromium Code Reviews| 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 679 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_VIEW); | 679 ProfileMetrics::PROFILE_AVATAR_MENU_NOT_YOU_VIEW); |
| 680 break; | 680 break; |
| 681 default: | 681 default: |
| 682 layout = CreateSingleColumnLayout(this, kFixedMenuWidth); | 682 layout = CreateSingleColumnLayout(this, kFixedMenuWidth); |
| 683 sub_view = CreateProfileChooserView(avatar_menu); | 683 sub_view = CreateProfileChooserView(avatar_menu); |
| 684 } | 684 } |
| 685 // Clears tutorial mode for all non-profile-chooser views. | 685 // Clears tutorial mode for all non-profile-chooser views. |
| 686 if (view_mode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) | 686 if (view_mode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER) |
| 687 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; | 687 tutorial_mode_ = profiles::TUTORIAL_MODE_NONE; |
| 688 | 688 |
| 689 if (view_mode_ != profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER || | |
| 690 tutorial_mode_ != profiles::TUTORIAL_MODE_NONE) | |
| 691 profile_bubble_->set_close_on_deactivate(false); | |
| 692 else | |
| 693 profile_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); | |
| 694 | |
|
Roger Tawa OOO till Jul 10th
2015/05/08 14:51:17
Nit: since this is a multi-line/complex if-then-el
| |
| 689 layout->StartRow(1, 0); | 695 layout->StartRow(1, 0); |
| 690 layout->AddView(sub_view); | 696 layout->AddView(sub_view); |
| 691 Layout(); | 697 Layout(); |
| 692 if (GetBubbleFrameView()) | 698 if (GetBubbleFrameView()) |
| 693 SizeToContents(); | 699 SizeToContents(); |
| 694 } | 700 } |
| 695 | 701 |
| 696 void ProfileChooserView::WindowClosing() { | 702 void ProfileChooserView::WindowClosing() { |
| 697 DCHECK_EQ(profile_bubble_, this); | 703 DCHECK_EQ(profile_bubble_, this); |
| 698 profile_bubble_ = NULL; | 704 profile_bubble_ = NULL; |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1704 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1710 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1705 IncognitoModePrefs::DISABLED; | 1711 IncognitoModePrefs::DISABLED; |
| 1706 return incognito_available && !browser_->profile()->IsGuestSession(); | 1712 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1707 } | 1713 } |
| 1708 | 1714 |
| 1709 void ProfileChooserView::PostActionPerformed( | 1715 void ProfileChooserView::PostActionPerformed( |
| 1710 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1716 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1711 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1717 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1712 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1718 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1713 } | 1719 } |
| OLD | NEW |