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

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

Issue 312333005: Make the "Tabs" item on about:sync non-yellow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added IsProxyType function and unit test Created 6 years, 6 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | sync/internal_api/public/base/model_type.h » ('j') | 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) 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/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1998 type_status.reset(new base::DictionaryValue()); 1998 type_status.reset(new base::DictionaryValue());
1999 type_status->SetString("name", ModelTypeToString(type)); 1999 type_status->SetString("name", ModelTypeToString(type));
2000 2000
2001 if (error_map.find(type) != error_map.end()) { 2001 if (error_map.find(type) != error_map.end()) {
2002 const syncer::SyncError &error = error_map.find(type)->second; 2002 const syncer::SyncError &error = error_map.find(type)->second;
2003 DCHECK(error.IsSet()); 2003 DCHECK(error.IsSet());
2004 std::string error_text = "Error: " + error.location().ToString() + 2004 std::string error_text = "Error: " + error.location().ToString() +
2005 ", " + error.message(); 2005 ", " + error.message();
2006 type_status->SetString("status", "error"); 2006 type_status->SetString("status", "error");
2007 type_status->SetString("value", error_text); 2007 type_status->SetString("value", error_text);
2008 } else if (syncer::IsProxyType(type) && passive_types.Has(type)) {
2009 // Show a proxy type in "ok" state unless it is disabled by user.
2010 DCHECK(!throttled_types.Has(type));
2011 type_status->SetString("status", "ok");
2012 type_status->SetString("value", "Passive");
2008 } else if (throttled_types.Has(type) && passive_types.Has(type)) { 2013 } else if (throttled_types.Has(type) && passive_types.Has(type)) {
2009 type_status->SetString("status", "warning"); 2014 type_status->SetString("status", "warning");
2010 type_status->SetString("value", "Passive, Throttled"); 2015 type_status->SetString("value", "Passive, Throttled");
2011 } else if (passive_types.Has(type)) { 2016 } else if (passive_types.Has(type)) {
2012 type_status->SetString("status", "warning"); 2017 type_status->SetString("status", "warning");
2013 type_status->SetString("value", "Passive"); 2018 type_status->SetString("value", "Passive");
2014 } else if (throttled_types.Has(type)) { 2019 } else if (throttled_types.Has(type)) {
2015 type_status->SetString("status", "warning"); 2020 type_status->SetString("status", "warning");
2016 type_status->SetString("value", "Throttled"); 2021 type_status->SetString("value", "Throttled");
2017 } else if (GetRegisteredNonBlockingDataTypes().Has(type)) { 2022 } else if (GetRegisteredNonBlockingDataTypes().Has(type)) {
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2519 if (first_sync_time.is_null()) 2524 if (first_sync_time.is_null())
2520 return; 2525 return;
2521 2526
2522 clear_browsing_data_.Run(profile_, first_sync_time, base::Time::Now()); 2527 clear_browsing_data_.Run(profile_, first_sync_time, base::Time::Now());
2523 } 2528 }
2524 2529
2525 void ProfileSyncService::SetClearingBrowseringDataForTesting( 2530 void ProfileSyncService::SetClearingBrowseringDataForTesting(
2526 base::Callback<void(Profile*, base::Time, base::Time)> c) { 2531 base::Callback<void(Profile*, base::Time, base::Time)> c) {
2527 clear_browsing_data_ = c; 2532 clear_browsing_data_ = c;
2528 } 2533 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | sync/internal_api/public/base/model_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698