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

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

Issue 9251035: Delete lots of sync ServerConnectionManager code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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) 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL)); 284 l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL));
285 } 285 }
286 } else if (auth_error.state() != AuthError::NONE && 286 } else if (auth_error.state() != AuthError::NONE &&
287 auth_error.state() != AuthError::TWO_FACTOR) { 287 auth_error.state() != AuthError::TWO_FACTOR) {
288 if (status_label) { 288 if (status_label) {
289 status_label->clear(); 289 status_label->clear();
290 GetStatusLabelsForAuthError(auth_error, *service, status_label, NULL, 290 GetStatusLabelsForAuthError(auth_error, *service, status_label, NULL,
291 NULL, NULL, NULL); 291 NULL, NULL, NULL);
292 } 292 }
293 result_type = SYNC_ERROR; 293 result_type = SYNC_ERROR;
294 } else if (!status.authenticated) {
rlarocque 2012/01/19 02:23:05 Since status.authenticated correlates mostly with
295 if (status_label) {
296 status_label->assign(
297 l10n_util::GetStringUTF16(IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED));
298 }
299 } 294 }
300 } else if (service->unrecoverable_error_detected()) { 295 } else if (service->unrecoverable_error_detected()) {
301 result_type = SYNC_ERROR; 296 result_type = SYNC_ERROR;
302 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); 297 ProfileSyncService::Status status(service->QueryDetailedSyncStatus());
303 if (ShouldShowActionOnUI(status.sync_protocol_error)) { 298 if (ShouldShowActionOnUI(status.sync_protocol_error)) {
304 if (status_label) { 299 if (status_label) {
305 GetStatusForActionableError(status.sync_protocol_error, 300 GetStatusForActionableError(status.sync_protocol_error,
306 status_label); 301 status_label);
307 } 302 }
308 } else if (status_label) { 303 } else if (status_label) {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } else { 500 } else {
506 sync_api::SyncManager::Status full_status( 501 sync_api::SyncManager::Status full_status(
507 service->QueryDetailedSyncStatus()); 502 service->QueryDetailedSyncStatus());
508 503
509 strings->SetString("service_url", service->sync_service_url().spec()); 504 strings->SetString("service_url", service->sync_service_url().spec());
510 strings->SetString("summary", 505 strings->SetString("summary",
511 ProfileSyncService::BuildSyncStatusSummaryText( 506 ProfileSyncService::BuildSyncStatusSummaryText(
512 full_status.summary)); 507 full_status.summary));
513 508
514 strings->SetString("version", GetVersionString()); 509 strings->SetString("version", GetVersionString());
515 strings->Set("authenticated",
516 new base::FundamentalValue(full_status.authenticated));
517 strings->SetString("auth_problem", 510 strings->SetString("auth_problem",
518 sync_ui_util::MakeSyncAuthErrorText( 511 sync_ui_util::MakeSyncAuthErrorText(
519 service->GetAuthError().state())); 512 service->GetAuthError().state()));
520 513
521 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); 514 strings->SetString("time_since_sync", service->GetLastSyncedTimeString());
522 515
523 ListValue* details = new ListValue(); 516 ListValue* details = new ListValue();
524 strings->Set("details", details); 517 strings->Set("details", details);
525 sync_ui_util::AddBoolSyncDetail(details, "Sync Initialized", 518 sync_ui_util::AddBoolSyncDetail(details, "Sync Initialized",
526 service->sync_initialized()); 519 service->sync_initialized());
527 sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed", 520 sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed",
528 service->HasSyncSetupCompleted()); 521 service->HasSyncSetupCompleted());
529 sync_ui_util::AddStringSyncDetails( 522 sync_ui_util::AddStringSyncDetails(
530 details, 523 details,
531 "Client ID", 524 "Client ID",
532 full_status.unique_id.empty() ? "none" : full_status.unique_id); 525 full_status.unique_id.empty() ? "none" : full_status.unique_id);
533 sync_ui_util::AddBoolSyncDetail(details, 526 sync_ui_util::AddBoolSyncDetail(details,
534 "Server Up",
535 full_status.server_up);
536 sync_ui_util::AddBoolSyncDetail(details,
537 "Server Reachable",
538 full_status.server_reachable);
539 sync_ui_util::AddBoolSyncDetail(details,
540 "Server Broken", 527 "Server Broken",
541 full_status.server_broken); 528 full_status.server_broken);
542 sync_ui_util::AddBoolSyncDetail(details, 529 sync_ui_util::AddBoolSyncDetail(details,
543 "Notifications Enabled", 530 "Notifications Enabled",
544 full_status.notifications_enabled); 531 full_status.notifications_enabled);
545 sync_ui_util::AddIntSyncDetail(details, 532 sync_ui_util::AddIntSyncDetail(details,
546 "Notifications Received", 533 "Notifications Received",
547 full_status.notifications_received); 534 full_status.notifications_received);
548 sync_ui_util::AddIntSyncDetail(details, 535 sync_ui_util::AddIntSyncDetail(details,
549 "Notifiable Commits", 536 "Notifiable Commits",
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 } 693 }
707 } else { 694 } else {
708 version_modifier = " " + version_modifier; 695 version_modifier = " " + version_modifier;
709 } 696 }
710 return chrome_version.Name() + " " + chrome_version.OSType() + " " + 697 return chrome_version.Name() + " " + chrome_version.OSType() + " " +
711 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + 698 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" +
712 version_modifier; 699 version_modifier;
713 } 700 }
714 701
715 } // namespace sync_ui_util 702 } // namespace sync_ui_util
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | chrome/browser/sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698