| OLD | NEW |
| 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 "components/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 it != routing_info.end(); ++it) { | 1863 it != routing_info.end(); ++it) { |
| 1864 if (it->second == syncer::GROUP_PASSIVE) { | 1864 if (it->second == syncer::GROUP_PASSIVE) { |
| 1865 passive_types.Put(it->first); | 1865 passive_types.Put(it->first); |
| 1866 } else { | 1866 } else { |
| 1867 active_types.Put(it->first); | 1867 active_types.Put(it->first); |
| 1868 } | 1868 } |
| 1869 } | 1869 } |
| 1870 | 1870 |
| 1871 SyncBackendHost::Status detailed_status = backend_->GetDetailedStatus(); | 1871 SyncBackendHost::Status detailed_status = backend_->GetDetailedStatus(); |
| 1872 ModelTypeSet& throttled_types(detailed_status.throttled_types); | 1872 ModelTypeSet& throttled_types(detailed_status.throttled_types); |
| 1873 ModelTypeSet& backed_off_types(detailed_status.backed_off_types); |
| 1873 ModelTypeSet registered = GetRegisteredDataTypes(); | 1874 ModelTypeSet registered = GetRegisteredDataTypes(); |
| 1874 std::unique_ptr<base::DictionaryValue> type_status_header( | 1875 std::unique_ptr<base::DictionaryValue> type_status_header( |
| 1875 new base::DictionaryValue()); | 1876 new base::DictionaryValue()); |
| 1876 | 1877 |
| 1877 type_status_header->SetString("name", "Model Type"); | 1878 type_status_header->SetString("name", "Model Type"); |
| 1878 type_status_header->SetString("status", "header"); | 1879 type_status_header->SetString("status", "header"); |
| 1879 type_status_header->SetString("value", "Group Type"); | 1880 type_status_header->SetString("value", "Group Type"); |
| 1880 type_status_header->SetString("num_entries", "Total Entries"); | 1881 type_status_header->SetString("num_entries", "Total Entries"); |
| 1881 type_status_header->SetString("num_live", "Live Entries"); | 1882 type_status_header->SetString("num_live", "Live Entries"); |
| 1882 result->Append(std::move(type_status_header)); | 1883 result->Append(std::move(type_status_header)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1907 break; | 1908 break; |
| 1908 } | 1909 } |
| 1909 } else if (syncer::IsProxyType(type) && passive_types.Has(type)) { | 1910 } else if (syncer::IsProxyType(type) && passive_types.Has(type)) { |
| 1910 // Show a proxy type in "ok" state unless it is disabled by user. | 1911 // Show a proxy type in "ok" state unless it is disabled by user. |
| 1911 DCHECK(!throttled_types.Has(type)); | 1912 DCHECK(!throttled_types.Has(type)); |
| 1912 type_status->SetString("status", "ok"); | 1913 type_status->SetString("status", "ok"); |
| 1913 type_status->SetString("value", "Passive"); | 1914 type_status->SetString("value", "Passive"); |
| 1914 } else if (throttled_types.Has(type) && passive_types.Has(type)) { | 1915 } else if (throttled_types.Has(type) && passive_types.Has(type)) { |
| 1915 type_status->SetString("status", "warning"); | 1916 type_status->SetString("status", "warning"); |
| 1916 type_status->SetString("value", "Passive, Throttled"); | 1917 type_status->SetString("value", "Passive, Throttled"); |
| 1918 } else if (backed_off_types.Has(type) && passive_types.Has(type)) { |
| 1919 type_status->SetString("status", "warning"); |
| 1920 type_status->SetString("value", "Passive, Backed off"); |
| 1917 } else if (passive_types.Has(type)) { | 1921 } else if (passive_types.Has(type)) { |
| 1918 type_status->SetString("status", "warning"); | 1922 type_status->SetString("status", "warning"); |
| 1919 type_status->SetString("value", "Passive"); | 1923 type_status->SetString("value", "Passive"); |
| 1920 } else if (throttled_types.Has(type)) { | 1924 } else if (throttled_types.Has(type)) { |
| 1921 type_status->SetString("status", "warning"); | 1925 type_status->SetString("status", "warning"); |
| 1922 type_status->SetString("value", "Throttled"); | 1926 type_status->SetString("value", "Throttled"); |
| 1927 } else if (backed_off_types.Has(type)) { |
| 1928 type_status->SetString("status", "warning"); |
| 1929 type_status->SetString("value", "Backed off"); |
| 1923 } else if (active_types.Has(type)) { | 1930 } else if (active_types.Has(type)) { |
| 1924 type_status->SetString("status", "ok"); | 1931 type_status->SetString("status", "ok"); |
| 1925 type_status->SetString( | 1932 type_status->SetString( |
| 1926 "value", "Active: " + ModelSafeGroupToString(routing_info[type])); | 1933 "value", "Active: " + ModelSafeGroupToString(routing_info[type])); |
| 1927 } else { | 1934 } else { |
| 1928 type_status->SetString("status", "warning"); | 1935 type_status->SetString("status", "warning"); |
| 1929 type_status->SetString("value", "Disabled by User"); | 1936 type_status->SetString("value", "Disabled by User"); |
| 1930 } | 1937 } |
| 1931 | 1938 |
| 1932 const auto& dtc_iter = data_type_controllers_.find(type); | 1939 const auto& dtc_iter = data_type_controllers_.find(type); |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2529 | 2536 |
| 2530 DCHECK(startup_controller_->IsSetupInProgress()); | 2537 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2531 startup_controller_->SetSetupInProgress(false); | 2538 startup_controller_->SetSetupInProgress(false); |
| 2532 | 2539 |
| 2533 if (IsBackendInitialized()) | 2540 if (IsBackendInitialized()) |
| 2534 ReconfigureDatatypeManager(); | 2541 ReconfigureDatatypeManager(); |
| 2535 NotifyObservers(); | 2542 NotifyObservers(); |
| 2536 } | 2543 } |
| 2537 | 2544 |
| 2538 } // namespace browser_sync | 2545 } // namespace browser_sync |
| OLD | NEW |