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/prefs/pref_service.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 default: | 155 default: |
156 if (status_label) { | 156 if (status_label) { |
157 status_label->assign(l10n_util::GetStringUTF16( | 157 status_label->assign(l10n_util::GetStringUTF16( |
158 IDS_SYNC_ERROR_SIGNING_IN)); | 158 IDS_SYNC_ERROR_SIGNING_IN)); |
159 } | 159 } |
160 break; | 160 break; |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 void InitializePrefsForProfile(Profile* profile) { | 164 void InitializePrefsForProfile(Profile* profile) { |
165 if (profile->IsNewProfile() && switches::IsNewAvatarMenu()) { | 165 if (profile->IsNewProfile()) { |
166 // Suppresses the upgrade tutorial for a new profile. | 166 // Suppresses the upgrade tutorial for a new profile. |
167 profile->GetPrefs()->SetInteger( | 167 profile->GetPrefs()->SetInteger( |
168 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1); | 168 prefs::kProfileAvatarTutorialShown, kUpgradeWelcomeTutorialShowMax + 1); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 void ShowSigninErrorLearnMorePage(Profile* profile) { | 172 void ShowSigninErrorLearnMorePage(Profile* profile) { |
173 static const char kSigninErrorLearnMoreUrl[] = | 173 static const char kSigninErrorLearnMoreUrl[] = |
174 "https://support.google.com/chrome/answer/1181420?"; | 174 "https://support.google.com/chrome/answer/1181420?"; |
175 chrome::NavigateParams params( | 175 chrome::NavigateParams params( |
176 profile, GURL(kSigninErrorLearnMoreUrl), ui::PAGE_TRANSITION_LINK); | 176 profile, GURL(kSigninErrorLearnMoreUrl), ui::PAGE_TRANSITION_LINK); |
177 params.disposition = NEW_FOREGROUND_TAB; | 177 params.disposition = NEW_FOREGROUND_TAB; |
178 chrome::Navigate(¶ms); | 178 chrome::Navigate(¶ms); |
179 } | 179 } |
180 | 180 |
181 std::string GetDisplayEmail(Profile* profile, const std::string& account_id) { | 181 std::string GetDisplayEmail(Profile* profile, const std::string& account_id) { |
182 AccountTrackerService* account_tracker = | 182 AccountTrackerService* account_tracker = |
183 AccountTrackerServiceFactory::GetForProfile(profile); | 183 AccountTrackerServiceFactory::GetForProfile(profile); |
184 std::string email = account_tracker->GetAccountInfo(account_id).email; | 184 std::string email = account_tracker->GetAccountInfo(account_id).email; |
185 if (email.empty()) { | 185 if (email.empty()) { |
186 DCHECK_EQ(AccountTrackerService::MIGRATION_NOT_STARTED, | 186 DCHECK_EQ(AccountTrackerService::MIGRATION_NOT_STARTED, |
187 account_tracker->GetMigrationState()); | 187 account_tracker->GetMigrationState()); |
188 return account_id; | 188 return account_id; |
189 } | 189 } |
190 return email; | 190 return email; |
191 } | 191 } |
192 | 192 |
193 } // namespace signin_ui_util | 193 } // namespace signin_ui_util |
OLD | NEW |