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

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: Address comments 2 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 514
514 weak_factory_.InvalidateWeakPtrs(); 515 weak_factory_.InvalidateWeakPtrs();
515 516
516 // Clear various flags. 517 // Clear various flags.
517 expect_sync_configuration_aborted_ = false; 518 expect_sync_configuration_aborted_ = false;
518 is_auth_in_progress_ = false; 519 is_auth_in_progress_ = false;
519 backend_initialized_ = false; 520 backend_initialized_ = false;
520 cached_passphrase_.clear(); 521 cached_passphrase_.clear();
521 encryption_pending_ = false; 522 encryption_pending_ = false;
522 encrypt_everything_ = false; 523 encrypt_everything_ = false;
523 encrypted_types_ = syncer::Cryptographer::SensitiveTypes(); 524 encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes();
524 passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED; 525 passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED;
525 last_auth_error_ = GoogleServiceAuthError::None(); 526 last_auth_error_ = GoogleServiceAuthError::None();
526 527
527 if (sync_global_error_.get()) { 528 if (sync_global_error_.get()) {
528 GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError( 529 GlobalErrorServiceFactory::GetForProfile(profile_)->RemoveGlobalError(
529 sync_global_error_.get()); 530 sync_global_error_.get());
530 RemoveObserver(sync_global_error_.get()); 531 RemoveObserver(sync_global_error_.get());
531 sync_global_error_.reset(NULL); 532 sync_global_error_.reset(NULL);
532 } 533 }
533 } 534 }
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 1800 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
1800 ProfileSyncService* old_this = this; 1801 ProfileSyncService* old_this = this;
1801 this->~ProfileSyncService(); 1802 this->~ProfileSyncService();
1802 new(old_this) ProfileSyncService( 1803 new(old_this) ProfileSyncService(
1803 new ProfileSyncComponentsFactoryImpl(profile, 1804 new ProfileSyncComponentsFactoryImpl(profile,
1804 CommandLine::ForCurrentProcess()), 1805 CommandLine::ForCurrentProcess()),
1805 profile, 1806 profile,
1806 signin, 1807 signin,
1807 behavior); 1808 behavior);
1808 } 1809 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698