| OLD | NEW |
| 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/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
| 19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 20 #include "base/string16.h" | 20 #include "base/string16.h" |
| 21 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
| 22 #include "base/task.h" | 22 #include "base/task.h" |
| 23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "chrome/browser/net/gaia/token_service.h" | 24 #include "chrome/browser/net/gaia/token_service.h" |
| 25 #include "chrome/browser/platform_util.h" | |
| 26 #include "chrome/browser/prefs/pref_service.h" | 25 #include "chrome/browser/prefs/pref_service.h" |
| 27 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 28 #include "chrome/browser/sync/backend_migrator.h" | 27 #include "chrome/browser/sync/backend_migrator.h" |
| 29 #include "chrome/browser/sync/engine/configure_reason.h" | 28 #include "chrome/browser/sync/engine/configure_reason.h" |
| 30 #include "chrome/browser/sync/engine/syncapi.h" | 29 #include "chrome/browser/sync/engine/syncapi.h" |
| 31 #include "chrome/browser/sync/glue/change_processor.h" | 30 #include "chrome/browser/sync/glue/change_processor.h" |
| 32 #include "chrome/browser/sync/glue/data_type_controller.h" | 31 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 33 #include "chrome/browser/sync/glue/data_type_manager.h" | 32 #include "chrome/browser/sync/glue/data_type_manager.h" |
| 34 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 33 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
| 35 #include "chrome/browser/sync/js_arg_list.h" | 34 #include "chrome/browser/sync/js_arg_list.h" |
| 36 #include "chrome/browser/sync/js_event_details.h" | 35 #include "chrome/browser/sync/js_event_details.h" |
| 37 #include "chrome/browser/sync/profile_sync_factory.h" | 36 #include "chrome/browser/sync/profile_sync_factory.h" |
| 38 #include "chrome/browser/sync/signin_manager.h" | 37 #include "chrome/browser/sync/signin_manager.h" |
| 39 #include "chrome/browser/ui/browser.h" | 38 #include "chrome/browser/ui/browser.h" |
| 40 #include "chrome/browser/ui/browser_list.h" | 39 #include "chrome/browser/ui/browser_list.h" |
| 41 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/chrome_version_info.h" |
| 42 #include "chrome/common/net/gaia/gaia_constants.h" | 42 #include "chrome/common/net/gaia/gaia_constants.h" |
| 43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/common/time_format.h" | 44 #include "chrome/common/time_format.h" |
| 45 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 46 #include "content/common/notification_details.h" | 46 #include "content/common/notification_details.h" |
| 47 #include "content/common/notification_source.h" | 47 #include "content/common/notification_source.h" |
| 48 #include "content/common/notification_type.h" | 48 #include "content/common/notification_type.h" |
| 49 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
| 50 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
| 51 | 51 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 81 scoped_runnable_method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 81 scoped_runnable_method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 82 expect_sync_configuration_aborted_(false), | 82 expect_sync_configuration_aborted_(false), |
| 83 clear_server_data_state_(CLEAR_NOT_STARTED) { | 83 clear_server_data_state_(CLEAR_NOT_STARTED) { |
| 84 // By default, dev, canary, and unbranded Chromium users will go to the | 84 // By default, dev, canary, and unbranded Chromium users will go to the |
| 85 // development servers. Development servers have more features than standard | 85 // development servers. Development servers have more features than standard |
| 86 // sync servers. Users with officially-branded Chrome stable and beta builds | 86 // sync servers. Users with officially-branded Chrome stable and beta builds |
| 87 // will go to the standard sync servers. | 87 // will go to the standard sync servers. |
| 88 // | 88 // |
| 89 // GetChannel hits the registry on Windows. See http://crbug.com/70380. | 89 // GetChannel hits the registry on Windows. See http://crbug.com/70380. |
| 90 base::ThreadRestrictions::ScopedAllowIO allow_io; | 90 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 91 platform_util::Channel channel = platform_util::GetChannel(); | 91 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 92 if (channel == platform_util::CHANNEL_STABLE || | 92 if (channel == chrome::VersionInfo::CHANNEL_STABLE || |
| 93 channel == platform_util::CHANNEL_BETA) { | 93 channel == chrome::VersionInfo::CHANNEL_BETA) { |
| 94 sync_service_url_ = GURL(kSyncServerUrl); | 94 sync_service_url_ = GURL(kSyncServerUrl); |
| 95 } | 95 } |
| 96 | 96 |
| 97 tried_implicit_gaia_remove_when_bug_62103_fixed_ = false; | 97 tried_implicit_gaia_remove_when_bug_62103_fixed_ = false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 ProfileSyncService::~ProfileSyncService() { | 100 ProfileSyncService::~ProfileSyncService() { |
| 101 Shutdown(false); | 101 Shutdown(false); |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 // is initialized, all enabled data types are consistent with one | 1338 // is initialized, all enabled data types are consistent with one |
| 1339 // another, and no unrecoverable error has transpired. | 1339 // another, and no unrecoverable error has transpired. |
| 1340 if (unrecoverable_error_detected_) | 1340 if (unrecoverable_error_detected_) |
| 1341 return false; | 1341 return false; |
| 1342 | 1342 |
| 1343 if (!data_type_manager_.get()) | 1343 if (!data_type_manager_.get()) |
| 1344 return false; | 1344 return false; |
| 1345 | 1345 |
| 1346 return data_type_manager_->state() == DataTypeManager::CONFIGURED; | 1346 return data_type_manager_->state() == DataTypeManager::CONFIGURED; |
| 1347 } | 1347 } |
| OLD | NEW |