Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1376)

Side by Side Diff: chrome/browser/sync/sync_ui_util.cc

Issue 7976018: [Sync Setup UI] Fix display of "Last Synced as..." in Personal Stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge + nit Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // NOT first machine. 224 // NOT first machine.
225 // Show a link ("needs attention"), but still indicate the 225 // Show a link ("needs attention"), but still indicate the
226 // current synced status. Return SYNC_PROMO so that 226 // current synced status. Return SYNC_PROMO so that
227 // the configure link will still be shown. 227 // the configure link will still be shown.
228 if (status_label && link_label) { 228 if (status_label && link_label) {
229 status_label->assign(GetSyncedStateStatusLabel(service)); 229 status_label->assign(GetSyncedStateStatusLabel(service));
230 link_label->assign( 230 link_label->assign(
231 l10n_util::GetStringUTF16(IDS_SYNC_PASSWORD_SYNC_ATTENTION)); 231 l10n_util::GetStringUTF16(IDS_SYNC_PASSWORD_SYNC_ATTENTION));
232 } 232 }
233 return SYNC_PROMO; 233 return SYNC_PROMO;
234 } else {
235 // First machine. Don't show promotion, just show everything
236 // normal.
237 if (status_label)
238 status_label->assign(GetSyncedStateStatusLabel(service));
239 return SYNCED;
240 } 234 }
241 } 235 }
236
237 // There is no error. Display "Last synced..." message.
238 if (status_label)
239 status_label->assign(GetSyncedStateStatusLabel(service));
242 return SYNCED; 240 return SYNCED;
243 } else { 241 } else {
244 // Either show auth error information with a link to re-login, auth in prog, 242 // Either show auth error information with a link to re-login, auth in prog,
245 // or provide a link to continue with setup. 243 // or provide a link to continue with setup.
246 result_type = PRE_SYNCED; 244 result_type = PRE_SYNCED;
247 if (service->SetupInProgress()) { 245 if (service->SetupInProgress()) {
248 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); 246 ProfileSyncService::Status status(service->QueryDetailedSyncStatus());
249 const AuthError& auth_error = service->GetAuthError(); 247 const AuthError& auth_error = service->GetAuthError();
250 if (status_label) { 248 if (status_label) {
251 status_label->assign( 249 status_label->assign(
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 DictionaryValue* val = new DictionaryValue; 644 DictionaryValue* val = new DictionaryValue;
647 val->SetString("model_type", ModelTypeToString(it->first)); 645 val->SetString("model_type", ModelTypeToString(it->first));
648 val->SetString("group", ModelSafeGroupToString(it->second)); 646 val->SetString("group", ModelSafeGroupToString(it->second));
649 routing_info->Append(val); 647 routing_info->Append(val);
650 } 648 }
651 } 649 }
652 } 650 }
653 } 651 }
654 652
655 } // namespace sync_ui_util 653 } // namespace sync_ui_util
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698