| 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 "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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 case browser_sync::DISABLE_SYNC_ON_CLIENT: | 959 case browser_sync::DISABLE_SYNC_ON_CLIENT: |
| 960 OnStopSyncingPermanently(); | 960 OnStopSyncingPermanently(); |
| 961 break; | 961 break; |
| 962 default: | 962 default: |
| 963 NOTREACHED(); | 963 NOTREACHED(); |
| 964 } | 964 } |
| 965 NotifyObservers(); | 965 NotifyObservers(); |
| 966 } | 966 } |
| 967 | 967 |
| 968 void ProfileSyncService::ShowErrorUI() { | 968 void ProfileSyncService::ShowErrorUI() { |
| 969 #if !defined(OS_ANDROID) |
| 970 // Android uses native UI for sync setup. |
| 969 // TODO(atwilson): Remove this. | 971 // TODO(atwilson): Remove this. |
| 970 LoginUIServiceFactory::GetForProfile(profile_)->ShowLoginUI(false); | 972 LoginUIServiceFactory::GetForProfile(profile_)->ShowLoginUI(false); |
| 973 #endif |
| 971 } | 974 } |
| 972 | 975 |
| 973 std::string ProfileSyncService::QuerySyncStatusSummary() { | 976 std::string ProfileSyncService::QuerySyncStatusSummary() { |
| 974 if (unrecoverable_error_detected_) { | 977 if (unrecoverable_error_detected_) { |
| 975 return "Unrecoverable error detected"; | 978 return "Unrecoverable error detected"; |
| 976 } else if (!backend_.get()) { | 979 } else if (!backend_.get()) { |
| 977 return "Syncing not enabled"; | 980 return "Syncing not enabled"; |
| 978 } else if (backend_.get() && !HasSyncSetupCompleted()) { | 981 } else if (backend_.get() && !HasSyncSetupCompleted()) { |
| 979 return "First time sync setup incomplete"; | 982 return "First time sync setup incomplete"; |
| 980 } else if (backend_.get() && HasSyncSetupCompleted() && | 983 } else if (backend_.get() && HasSyncSetupCompleted() && |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1610 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1613 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
| 1611 ProfileSyncService* old_this = this; | 1614 ProfileSyncService* old_this = this; |
| 1612 this->~ProfileSyncService(); | 1615 this->~ProfileSyncService(); |
| 1613 new(old_this) ProfileSyncService( | 1616 new(old_this) ProfileSyncService( |
| 1614 new ProfileSyncComponentsFactoryImpl(profile, | 1617 new ProfileSyncComponentsFactoryImpl(profile, |
| 1615 CommandLine::ForCurrentProcess()), | 1618 CommandLine::ForCurrentProcess()), |
| 1616 profile, | 1619 profile, |
| 1617 signin, | 1620 signin, |
| 1618 behavior); | 1621 behavior); |
| 1619 } | 1622 } |
| OLD | NEW |