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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 } else if (sender == tutorial_not_you_link_) { | 985 } else if (sender == tutorial_not_you_link_) { |
986 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( | 986 ProfileMetrics::LogProfileNewAvatarMenuUpgrade( |
987 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); | 987 ProfileMetrics::PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU); |
988 ShowView(profiles::BUBBLE_VIEW_MODE_SWITCH_USER, avatar_menu_.get()); | 988 ShowView(profiles::BUBBLE_VIEW_MODE_SWITCH_USER, avatar_menu_.get()); |
989 } else { | 989 } else { |
990 DCHECK(sender == tutorial_learn_more_link_); | 990 DCHECK(sender == tutorial_learn_more_link_); |
991 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); | 991 signin_ui_util::ShowSigninErrorLearnMorePage(browser_->profile()); |
992 } | 992 } |
993 } | 993 } |
994 | 994 |
995 void ProfileChooserView::StyledLabelLinkClicked( | 995 void ProfileChooserView::StyledLabelLinkClicked(views::StyledLabel* label, |
996 const gfx::Range& range, int event_flags) { | 996 const gfx::Range& range, |
| 997 int event_flags) { |
997 chrome::ShowSettings(browser_); | 998 chrome::ShowSettings(browser_); |
998 } | 999 } |
999 | 1000 |
1000 bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender, | 1001 bool ProfileChooserView::HandleKeyEvent(views::Textfield* sender, |
1001 const ui::KeyEvent& key_event) { | 1002 const ui::KeyEvent& key_event) { |
1002 views::Textfield* name_textfield = | 1003 views::Textfield* name_textfield = |
1003 current_profile_name_->profile_name_textfield(); | 1004 current_profile_name_->profile_name_textfield(); |
1004 DCHECK(sender == name_textfield); | 1005 DCHECK(sender == name_textfield); |
1005 | 1006 |
1006 if (key_event.key_code() == ui::VKEY_RETURN || | 1007 if (key_event.key_code() == ui::VKEY_RETURN || |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1871 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1871 IncognitoModePrefs::DISABLED; | 1872 IncognitoModePrefs::DISABLED; |
1872 return incognito_available && !browser_->profile()->IsGuestSession(); | 1873 return incognito_available && !browser_->profile()->IsGuestSession(); |
1873 } | 1874 } |
1874 | 1875 |
1875 void ProfileChooserView::PostActionPerformed( | 1876 void ProfileChooserView::PostActionPerformed( |
1876 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1877 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1877 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1878 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1878 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1879 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1879 } | 1880 } |
OLD | NEW |