| 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/sync/sync_ui_util.h" | 5 #include "chrome/browser/sync/sync_ui_util.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // Only display an error if we've completed sync setup. | 340 // Only display an error if we've completed sync setup. |
| 341 if (!service->HasSyncSetupCompleted()) | 341 if (!service->HasSyncSetupCompleted()) |
| 342 return; | 342 return; |
| 343 | 343 |
| 344 // Display a passphrase error if we have one. | 344 // Display a passphrase error if we have one. |
| 345 if (service->IsPassphraseRequired() && | 345 if (service->IsPassphraseRequired() && |
| 346 service->IsPassphraseRequiredForDecryption()) { | 346 service->IsPassphraseRequiredForDecryption()) { |
| 347 // This is not the first machine so ask user to enter passphrase. | 347 // This is not the first machine so ask user to enter passphrase. |
| 348 *menu_label = l10n_util::GetStringUTF16( | 348 *menu_label = l10n_util::GetStringUTF16( |
| 349 IDS_SYNC_PASSPHRASE_ERROR_WRENCH_MENU_ITEM); | 349 IDS_SYNC_PASSPHRASE_ERROR_WRENCH_MENU_ITEM); |
| 350 base::string16 product_name = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); | 350 *bubble_message = l10n_util::GetStringUTF16( |
| 351 *bubble_message = l10n_util::GetStringFUTF16( | 351 IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE); |
| 352 IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE, product_name); | |
| 353 *bubble_accept_label = l10n_util::GetStringUTF16( | 352 *bubble_accept_label = l10n_util::GetStringUTF16( |
| 354 IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_ACCEPT); | 353 IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_ACCEPT); |
| 355 return; | 354 return; |
| 356 } | 355 } |
| 357 } | 356 } |
| 358 | 357 |
| 359 MessageType GetStatus( | 358 MessageType GetStatus( |
| 360 ProfileSyncService* service, const SigninManagerBase& signin) { | 359 ProfileSyncService* service, const SigninManagerBase& signin) { |
| 361 return sync_ui_util::GetStatusInfo(service, signin, WITH_HTML, NULL, NULL); | 360 return sync_ui_util::GetStatusInfo(service, signin, WITH_HTML, NULL, NULL); |
| 362 } | 361 } |
| 363 | 362 |
| 364 base::string16 ConstructTime(int64 time_in_int) { | 363 base::string16 ConstructTime(int64 time_in_int) { |
| 365 base::Time time = base::Time::FromInternalValue(time_in_int); | 364 base::Time time = base::Time::FromInternalValue(time_in_int); |
| 366 | 365 |
| 367 // If time is null the format function returns a time in 1969. | 366 // If time is null the format function returns a time in 1969. |
| 368 if (time.is_null()) | 367 if (time.is_null()) |
| 369 return base::string16(); | 368 return base::string16(); |
| 370 return base::TimeFormatFriendlyDateAndTime(time); | 369 return base::TimeFormatFriendlyDateAndTime(time); |
| 371 } | 370 } |
| 372 | 371 |
| 373 } // namespace sync_ui_util | 372 } // namespace sync_ui_util |
| OLD | NEW |