OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/signin/signin_ui_util.h" | 5 #include "chrome/browser/signin/signin_ui_util.h" |
6 | 6 |
| 7 #include "base/prefs/pref_service.h" |
7 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
11 #include "chrome/browser/signin/signin_global_error.h" | 12 #include "chrome/browser/signin/signin_global_error.h" |
12 #include "chrome/browser/signin/signin_global_error_factory.h" | 13 #include "chrome/browser/signin/signin_global_error_factory.h" |
13 #include "chrome/browser/signin/signin_manager_factory.h" | 14 #include "chrome/browser/signin/signin_manager_factory.h" |
14 #include "chrome/browser/sync/profile_sync_service.h" | 15 #include "chrome/browser/sync/profile_sync_service.h" |
15 #include "chrome/browser/sync/profile_sync_service_factory.h" | 16 #include "chrome/browser/sync/profile_sync_service_factory.h" |
16 #include "chrome/browser/sync/sync_global_error.h" | 17 #include "chrome/browser/sync/sync_global_error.h" |
17 #include "chrome/browser/sync/sync_global_error_factory.h" | 18 #include "chrome/browser/sync/sync_global_error_factory.h" |
| 19 #include "chrome/common/pref_names.h" |
18 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 20 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
19 #include "components/signin/core/browser/signin_manager.h" | 21 #include "components/signin/core/browser/signin_manager.h" |
| 22 #include "components/signin/core/common/profile_management_switches.h" |
20 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
21 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
22 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
23 #include "ui/gfx/font_list.h" | 26 #include "ui/gfx/font_list.h" |
24 #include "ui/gfx/text_elider.h" | 27 #include "ui/gfx/text_elider.h" |
25 | 28 |
26 namespace { | 29 namespace { |
27 // Maximum width of a username - we trim emails that are wider than this so | 30 // Maximum width of a username - we trim emails that are wider than this so |
28 // the wrench menu doesn't get ridiculously wide. | 31 // the wrench menu doesn't get ridiculously wide. |
29 const int kUsernameMaxWidth = 200; | 32 const int kUsernameMaxWidth = 200; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 break; | 149 break; |
147 default: | 150 default: |
148 if (status_label) { | 151 if (status_label) { |
149 status_label->assign(l10n_util::GetStringUTF16( | 152 status_label->assign(l10n_util::GetStringUTF16( |
150 IDS_SYNC_ERROR_SIGNING_IN)); | 153 IDS_SYNC_ERROR_SIGNING_IN)); |
151 } | 154 } |
152 break; | 155 break; |
153 } | 156 } |
154 } | 157 } |
155 | 158 |
| 159 void InitializePrefsForProfile(Profile* profile) { |
| 160 // Suppresses the upgrade tutorial for a new profile. |
| 161 if (profile->IsNewProfile() && switches::IsNewAvatarMenu()) { |
| 162 profile->GetPrefs()->SetInteger( |
| 163 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1); |
| 164 } |
| 165 } |
| 166 |
156 } // namespace signin_ui_util | 167 } // namespace signin_ui_util |
OLD | NEW |