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

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

Issue 10827266: [Sync] Add SyncEncryptionHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 years, 4 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) 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "chrome/common/chrome_version_info.h" 51 #include "chrome/common/chrome_version_info.h"
52 #include "chrome/common/net/gaia/gaia_constants.h" 52 #include "chrome/common/net/gaia/gaia_constants.h"
53 #include "chrome/common/time_format.h" 53 #include "chrome/common/time_format.h"
54 #include "chrome/common/url_constants.h" 54 #include "chrome/common/url_constants.h"
55 #include "content/public/browser/notification_details.h" 55 #include "content/public/browser/notification_details.h"
56 #include "content/public/browser/notification_source.h" 56 #include "content/public/browser/notification_source.h"
57 #include "grit/generated_resources.h" 57 #include "grit/generated_resources.h"
58 #include "net/cookies/cookie_monster.h" 58 #include "net/cookies/cookie_monster.h"
59 #include "sync/api/sync_error.h" 59 #include "sync/api/sync_error.h"
60 #include "sync/internal_api/public/configure_reason.h" 60 #include "sync/internal_api/public/configure_reason.h"
61 #include "sync/internal_api/public/sync_encryption_handler.h"
61 #include "sync/internal_api/public/util/experiments.h" 62 #include "sync/internal_api/public/util/experiments.h"
62 #include "sync/internal_api/public/util/sync_string_conversions.h" 63 #include "sync/internal_api/public/util/sync_string_conversions.h"
63 #include "sync/js/js_arg_list.h" 64 #include "sync/js/js_arg_list.h"
64 #include "sync/js/js_event_details.h" 65 #include "sync/js/js_event_details.h"
65 #include "sync/util/cryptographer.h" 66 #include "sync/util/cryptographer.h"
66 #include "ui/base/l10n/l10n_util.h" 67 #include "ui/base/l10n/l10n_util.h"
67 68
68 using browser_sync::ChangeProcessor; 69 using browser_sync::ChangeProcessor;
69 using browser_sync::DataTypeController; 70 using browser_sync::DataTypeController;
70 using browser_sync::DataTypeManager; 71 using browser_sync::DataTypeManager;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 sync_prefs_(profile_ ? profile_->GetPrefs() : NULL), 127 sync_prefs_(profile_ ? profile_->GetPrefs() : NULL),
127 invalidator_storage_(profile_ ? profile_->GetPrefs(): NULL), 128 invalidator_storage_(profile_ ? profile_->GetPrefs(): NULL),
128 sync_service_url_(kDevServerUrl), 129 sync_service_url_(kDevServerUrl),
129 is_first_time_sync_configure_(false), 130 is_first_time_sync_configure_(false),
130 backend_initialized_(false), 131 backend_initialized_(false),
131 is_auth_in_progress_(false), 132 is_auth_in_progress_(false),
132 signin_(signin_manager), 133 signin_(signin_manager),
133 unrecoverable_error_reason_(ERROR_REASON_UNSET), 134 unrecoverable_error_reason_(ERROR_REASON_UNSET),
134 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), 135 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
135 expect_sync_configuration_aborted_(false), 136 expect_sync_configuration_aborted_(false),
136 encrypted_types_(syncer::Cryptographer::SensitiveTypes()), 137 encrypted_types_(syncer::SyncEncryptionHandler::SensitiveTypes()),
137 encrypt_everything_(false), 138 encrypt_everything_(false),
138 encryption_pending_(false), 139 encryption_pending_(false),
139 auto_start_enabled_(start_behavior == AUTO_START), 140 auto_start_enabled_(start_behavior == AUTO_START),
140 failed_datatypes_handler_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), 141 failed_datatypes_handler_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
141 configure_status_(DataTypeManager::UNKNOWN), 142 configure_status_(DataTypeManager::UNKNOWN),
142 setup_in_progress_(false) { 143 setup_in_progress_(false) {
143 #if defined(OS_ANDROID) 144 #if defined(OS_ANDROID)
144 chrome::VersionInfo version_info; 145 chrome::VersionInfo version_info;
145 if (version_info.IsOfficialBuild()) { 146 if (version_info.IsOfficialBuild()) {
146 sync_service_url_ = GURL(kSyncServerUrl); 147 sync_service_url_ = GURL(kSyncServerUrl);
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 526
526 weak_factory_.InvalidateWeakPtrs(); 527 weak_factory_.InvalidateWeakPtrs();
527 528
528 // Clear various flags. 529 // Clear various flags.
529 expect_sync_configuration_aborted_ = false; 530 expect_sync_configuration_aborted_ = false;
530 is_auth_in_progress_ = false; 531 is_auth_in_progress_ = false;
531 backend_initialized_ = false; 532 backend_initialized_ = false;
532 cached_passphrase_.clear(); 533 cached_passphrase_.clear();
533 encryption_pending_ = false; 534 encryption_pending_ = false;
534 encrypt_everything_ = false; 535 encrypt_everything_ = false;
535 encrypted_types_ = syncer::Cryptographer::SensitiveTypes(); 536 encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes();
536 passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED; 537 passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED;
537 last_auth_error_ = GoogleServiceAuthError::None(); 538 last_auth_error_ = GoogleServiceAuthError::None();
538 539
539 if (sync_global_error_.get()) { 540 if (sync_global_error_.get()) {
540 GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError( 541 GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError(
541 sync_global_error_.get()); 542 sync_global_error_.get());
542 RemoveObserver(sync_global_error_.get()); 543 RemoveObserver(sync_global_error_.get());
543 sync_global_error_.reset(NULL); 544 sync_global_error_.reset(NULL);
544 } 545 }
545 } 546 }
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 1812 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
1812 ProfileSyncService* old_this = this; 1813 ProfileSyncService* old_this = this;
1813 this->~ProfileSyncService(); 1814 this->~ProfileSyncService();
1814 new(old_this) ProfileSyncService( 1815 new(old_this) ProfileSyncService(
1815 new ProfileSyncComponentsFactoryImpl(profile, 1816 new ProfileSyncComponentsFactoryImpl(profile,
1816 CommandLine::ForCurrentProcess()), 1817 CommandLine::ForCurrentProcess()),
1817 profile, 1818 profile,
1818 signin, 1819 signin,
1819 behavior); 1820 behavior);
1820 } 1821 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.cc ('k') | chrome/browser/sync/profile_sync_service_bookmark_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698