OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Returns the message that should be displayed when the user is authenticated | 72 // Returns the message that should be displayed when the user is authenticated |
73 // and can connect to the sync server. If the user hasn't yet authenticated, an | 73 // and can connect to the sync server. If the user hasn't yet authenticated, an |
74 // empty string is returned. | 74 // empty string is returned. |
75 string16 GetSyncedStateStatusLabel(ProfileSyncService* service) { | 75 string16 GetSyncedStateStatusLabel(ProfileSyncService* service) { |
76 string16 label; | 76 string16 label; |
77 string16 user_name(service->GetAuthenticatedUsername()); | 77 string16 user_name(service->GetAuthenticatedUsername()); |
78 if (user_name.empty()) | 78 if (user_name.empty()) |
79 return label; | 79 return label; |
80 | 80 |
81 return l10n_util::GetStringFUTF16( | 81 return l10n_util::GetStringFUTF16( |
82 ProfileManager::IsMultipleProfilesEnabled() ? | 82 IDS_SYNC_ACCOUNT_SYNCING_TO_USER, |
83 IDS_PROFILES_SYNCED_TO_USER_WITH_TIME : | |
84 IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, | |
85 user_name, | 83 user_name, |
86 service->GetLastSyncedTimeString()); | 84 ASCIIToUTF16(chrome::kSyncGoogleDashboardURL)); |
87 } | 85 } |
88 | 86 |
89 void GetStatusForActionableError( | 87 void GetStatusForActionableError( |
90 const browser_sync::SyncProtocolError& error, | 88 const browser_sync::SyncProtocolError& error, |
91 string16* status_label) { | 89 string16* status_label) { |
92 DCHECK(status_label); | 90 DCHECK(status_label); |
93 switch (error.action) { | 91 switch (error.action) { |
94 case browser_sync::STOP_AND_RESTART_SYNC: | 92 case browser_sync::STOP_AND_RESTART_SYNC: |
95 status_label->assign( | 93 status_label->assign( |
96 l10n_util::GetStringUTF16(IDS_SYNC_STOP_AND_RESTART_SYNC)); | 94 l10n_util::GetStringUTF16(IDS_SYNC_STOP_AND_RESTART_SYNC)); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 DictionaryValue* val = new DictionaryValue; | 548 DictionaryValue* val = new DictionaryValue; |
551 val->SetString("model_type", ModelTypeToString(it->first)); | 549 val->SetString("model_type", ModelTypeToString(it->first)); |
552 val->SetString("group", ModelSafeGroupToString(it->second)); | 550 val->SetString("group", ModelSafeGroupToString(it->second)); |
553 routing_info->Append(val); | 551 routing_info->Append(val); |
554 } | 552 } |
555 } | 553 } |
556 } | 554 } |
557 } | 555 } |
558 | 556 |
559 } // namespace sync_ui_util | 557 } // namespace sync_ui_util |
OLD | NEW |