| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
| 13 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
| 14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/app/chrome_command_ids.h" | 19 #include "chrome/app/chrome_command_ids.h" |
| 20 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/google/google_util.h" | 21 #include "chrome/browser/google/google_util.h" |
| 21 #include "chrome/browser/lifetime/application_lifetime.h" | 22 #include "chrome/browser/lifetime/application_lifetime.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/profiles/profile_info_cache.h" | 24 #include "chrome/browser/profiles/profile_info_cache.h" |
| 24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| 25 #include "chrome/browser/profiles/profile_metrics.h" | 26 #include "chrome/browser/profiles/profile_metrics.h" |
| 26 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 27 #include "chrome/browser/signin/signin_header_helper.h" | 28 #include "chrome/browser/signin/signin_header_helper.h" |
| 28 #include "chrome/browser/signin/signin_manager_factory.h" | 29 #include "chrome/browser/signin/signin_manager_factory.h" |
| 29 #include "chrome/browser/signin/signin_promo.h" | 30 #include "chrome/browser/signin/signin_promo.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 localized_strings->SetString( | 215 localized_strings->SetString( |
| 215 "encryptionInstructions", | 216 "encryptionInstructions", |
| 216 GetStringFUTF16(IDS_SYNC_ENCRYPTION_INSTRUCTIONS, product_name)); | 217 GetStringFUTF16(IDS_SYNC_ENCRYPTION_INSTRUCTIONS, product_name)); |
| 217 localized_strings->SetString( | 218 localized_strings->SetString( |
| 218 "encryptionHelpURL", chrome::kSyncEncryptionHelpURL); | 219 "encryptionHelpURL", chrome::kSyncEncryptionHelpURL); |
| 219 localized_strings->SetString( | 220 localized_strings->SetString( |
| 220 "encryptionSectionMessage", | 221 "encryptionSectionMessage", |
| 221 GetStringFUTF16(IDS_SYNC_ENCRYPTION_SECTION_MESSAGE, product_name)); | 222 GetStringFUTF16(IDS_SYNC_ENCRYPTION_SECTION_MESSAGE, product_name)); |
| 222 localized_strings->SetString( | 223 localized_strings->SetString( |
| 223 "passphraseRecover", | 224 "passphraseRecover", |
| 224 GetStringFUTF16(IDS_SYNC_PASSPHRASE_RECOVER, | 225 GetStringFUTF16( |
| 225 base::ASCIIToUTF16( | 226 IDS_SYNC_PASSPHRASE_RECOVER, |
| 226 google_util::StringAppendGoogleLocaleParam( | 227 base::ASCIIToUTF16( |
| 227 chrome::kSyncGoogleDashboardURL)))); | 228 google_util::AppendGoogleLocaleParam( |
| 228 localized_strings->SetString("stopSyncingExplanation", | 229 GURL(chrome::kSyncGoogleDashboardURL), |
| 230 g_browser_process->GetApplicationLocale()).spec()))); |
| 231 localized_strings->SetString( |
| 232 "stopSyncingExplanation", |
| 229 l10n_util::GetStringFUTF16( | 233 l10n_util::GetStringFUTF16( |
| 230 IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL, | 234 IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL, |
| 231 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 235 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 232 base::ASCIIToUTF16(google_util::StringAppendGoogleLocaleParam( | 236 base::ASCIIToUTF16( |
| 233 chrome::kSyncGoogleDashboardURL)))); | 237 google_util::AppendGoogleLocaleParam( |
| 238 GURL(chrome::kSyncGoogleDashboardURL), |
| 239 g_browser_process->GetApplicationLocale()).spec()))); |
| 234 localized_strings->SetString("deleteProfileLabel", | 240 localized_strings->SetString("deleteProfileLabel", |
| 235 l10n_util::GetStringUTF16(IDS_SYNC_STOP_DELETE_PROFILE_LABEL)); | 241 l10n_util::GetStringUTF16(IDS_SYNC_STOP_DELETE_PROFILE_LABEL)); |
| 236 localized_strings->SetString("stopSyncingTitle", | 242 localized_strings->SetString("stopSyncingTitle", |
| 237 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_DIALOG_TITLE)); | 243 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_DIALOG_TITLE)); |
| 238 localized_strings->SetString("stopSyncingConfirm", | 244 localized_strings->SetString("stopSyncingConfirm", |
| 239 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL)); | 245 l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL)); |
| 240 | 246 |
| 241 localized_strings->SetString( | 247 localized_strings->SetString( |
| 242 "syncEverythingHelpURL", chrome::kSyncEverythingLearnMoreURL); | 248 "syncEverythingHelpURL", chrome::kSyncEverythingLearnMoreURL); |
| 243 localized_strings->SetString( | 249 localized_strings->SetString( |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 944 |
| 939 LoginUIService* service = GetLoginUIService(); | 945 LoginUIService* service = GetLoginUIService(); |
| 940 DCHECK(service); | 946 DCHECK(service); |
| 941 service->current_login_ui()->FocusUI(); | 947 service->current_login_ui()->FocusUI(); |
| 942 return true; | 948 return true; |
| 943 } | 949 } |
| 944 | 950 |
| 945 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 951 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
| 946 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 952 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
| 947 } | 953 } |
| OLD | NEW |