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

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

Issue 9348036: Trim code from sync's ServerConnectionManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after Fred's patch Created 8 years, 9 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
OLDNEW
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/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL)); 312 l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL));
313 } 313 }
314 } else if (auth_error.state() != AuthError::NONE && 314 } else if (auth_error.state() != AuthError::NONE &&
315 auth_error.state() != AuthError::TWO_FACTOR) { 315 auth_error.state() != AuthError::TWO_FACTOR) {
316 if (status_label) { 316 if (status_label) {
317 status_label->clear(); 317 status_label->clear();
318 GetStatusLabelsForAuthError(auth_error, *service, status_label, NULL, 318 GetStatusLabelsForAuthError(auth_error, *service, status_label, NULL,
319 NULL, NULL, NULL); 319 NULL, NULL, NULL);
320 } 320 }
321 result_type = SYNC_ERROR; 321 result_type = SYNC_ERROR;
322 } else if (!status.authenticated) {
323 if (status_label) {
324 status_label->assign(
325 l10n_util::GetStringUTF16(IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED));
326 }
327 } 322 }
328 } else if (service->unrecoverable_error_detected()) { 323 } else if (service->unrecoverable_error_detected()) {
329 result_type = SYNC_ERROR; 324 result_type = SYNC_ERROR;
330 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); 325 ProfileSyncService::Status status(service->QueryDetailedSyncStatus());
331 if (ShouldShowActionOnUI(status.sync_protocol_error)) { 326 if (ShouldShowActionOnUI(status.sync_protocol_error)) {
332 if (status_label) { 327 if (status_label) {
333 GetStatusForActionableError(status.sync_protocol_error, 328 GetStatusForActionableError(status.sync_protocol_error,
334 status_label); 329 status_label);
335 } 330 }
336 } else if (status_label) { 331 } else if (status_label) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 } else { 505 } else {
511 sync_api::SyncManager::Status full_status( 506 sync_api::SyncManager::Status full_status(
512 service->QueryDetailedSyncStatus()); 507 service->QueryDetailedSyncStatus());
513 508
514 strings->SetString("service_url", service->sync_service_url().spec()); 509 strings->SetString("service_url", service->sync_service_url().spec());
515 strings->SetString("summary", 510 strings->SetString("summary",
516 ProfileSyncService::BuildSyncStatusSummaryText( 511 ProfileSyncService::BuildSyncStatusSummaryText(
517 full_status.summary)); 512 full_status.summary));
518 513
519 strings->SetString("version", GetVersionString()); 514 strings->SetString("version", GetVersionString());
520 strings->Set("authenticated",
521 new base::FundamentalValue(full_status.authenticated));
522 strings->SetString("auth_problem", 515 strings->SetString("auth_problem",
523 sync_ui_util::MakeSyncAuthErrorText( 516 sync_ui_util::MakeSyncAuthErrorText(
524 service->GetAuthError().state())); 517 service->GetAuthError().state()));
525 518
526 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); 519 strings->SetString("time_since_sync", service->GetLastSyncedTimeString());
527 520
528 ListValue* details = new ListValue(); 521 ListValue* details = new ListValue();
529 strings->Set("details", details); 522 strings->Set("details", details);
530 sync_ui_util::AddBoolSyncDetail(details, "Sync Initialized", 523 sync_ui_util::AddBoolSyncDetail(details, "Sync Initialized",
531 service->sync_initialized()); 524 service->sync_initialized());
532 sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed", 525 sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed",
533 service->HasSyncSetupCompleted()); 526 service->HasSyncSetupCompleted());
534 sync_ui_util::AddStringSyncDetails( 527 sync_ui_util::AddStringSyncDetails(
535 details, 528 details,
536 "Client ID", 529 "Client ID",
537 full_status.unique_id.empty() ? "none" : full_status.unique_id); 530 full_status.unique_id.empty() ? "none" : full_status.unique_id);
538 sync_ui_util::AddBoolSyncDetail(details, 531 sync_ui_util::AddBoolSyncDetail(details,
539 "Server Up",
540 full_status.server_up);
541 sync_ui_util::AddBoolSyncDetail(details,
542 "Server Reachable",
543 full_status.server_reachable);
544 sync_ui_util::AddBoolSyncDetail(details,
545 "Notifications Enabled", 532 "Notifications Enabled",
546 full_status.notifications_enabled); 533 full_status.notifications_enabled);
547 sync_ui_util::AddIntSyncDetail(details, 534 sync_ui_util::AddIntSyncDetail(details,
548 "Notifications Received", 535 "Notifications Received",
549 full_status.notifications_received); 536 full_status.notifications_received);
550 sync_ui_util::AddIntSyncDetail(details, 537 sync_ui_util::AddIntSyncDetail(details,
551 "Unsynced Count", 538 "Unsynced Count",
552 full_status.unsynced_count); 539 full_status.unsynced_count);
553 sync_ui_util::AddIntSyncDetail(details, 540 sync_ui_util::AddIntSyncDetail(details,
554 "Encryption Conflicts Detected (this cycle)", 541 "Encryption Conflicts Detected (this cycle)",
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 } 713 }
727 } else { 714 } else {
728 version_modifier = " " + version_modifier; 715 version_modifier = " " + version_modifier;
729 } 716 }
730 return chrome_version.Name() + " " + chrome_version.OSType() + " " + 717 return chrome_version.Name() + " " + chrome_version.OSType() + " " +
731 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + 718 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" +
732 version_modifier; 719 version_modifier;
733 } 720 }
734 721
735 } // namespace sync_ui_util 722 } // namespace sync_ui_util
OLDNEW
« no previous file with comments | « chrome/browser/sync/retry_verifier.h ('k') | chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698