diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-03-21 14:25:57 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-03-21 14:25:57 +0000 |
commit | 23730a6e56a168d1879203e4b3819bb36e3d8f1f (patch) | |
tree | 4b72bdd217f9beda1d1b975e21c9d646a9664c48 /chrome/browser/sync/glue | |
parent | 6d6d338a36340632714f2aab9a266979b71c3442 (diff) | |
download | chromium_org-23730a6e56a168d1879203e4b3819bb36e3d8f1f.tar.gz |
Merge from Chromium at DEPS revision 258528
This commit was generated by merge_to_master.py.
Change-Id: Id197cbdde2c2881915f096c0426c741416884783
Diffstat (limited to 'chrome/browser/sync/glue')
6 files changed, 33 insertions, 14 deletions
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 42f04dc58e..0287961061 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -29,9 +29,9 @@ #include "chrome/browser/sync/glue/synced_window_delegate.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "components/sessions/serialized_navigation_entry.h" +#include "components/sync_driver/sync_prefs.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/favicon_status.h" @@ -58,7 +58,6 @@ using content::BrowserThread; using content::NavigationEntry; -using prefs::kSyncSessionsGUID; using sessions::SerializedNavigationEntry; using syncer::SESSIONS; @@ -692,7 +691,7 @@ void SessionModelAssociator::InitializeCurrentMachineTag( DCHECK(CalledOnValidThread()); DCHECK(current_machine_tag_.empty()); std::string persisted_guid; - browser_sync::SyncPrefs prefs(profile_->GetPrefs()); + sync_driver::SyncPrefs prefs(profile_->GetPrefs()); persisted_guid = prefs.GetSyncSessionsGUID(); if (!persisted_guid.empty()) { current_machine_tag_ = persisted_guid; diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.cc b/chrome/browser/sync/glue/sync_backend_host_impl.cc index 8a9a3bfb6d..f5b2f6e467 100644 --- a/chrome/browser/sync/glue/sync_backend_host_impl.cc +++ b/chrome/browser/sync/glue/sync_backend_host_impl.cc @@ -12,9 +12,9 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/glue/sync_backend_host_core.h" #include "chrome/browser/sync/glue/sync_backend_registrar.h" -#include "chrome/browser/sync/sync_prefs.h" #include "chrome/common/chrome_switches.h" #include "components/sync_driver/sync_frontend.h" +#include "components/sync_driver/sync_prefs.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" @@ -46,7 +46,7 @@ namespace browser_sync { SyncBackendHostImpl::SyncBackendHostImpl( const std::string& name, Profile* profile, - const base::WeakPtr<SyncPrefs>& sync_prefs) + const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs) : frontend_loop_(base::MessageLoop::current()), profile_(profile), name_(name), diff --git a/chrome/browser/sync/glue/sync_backend_host_impl.h b/chrome/browser/sync/glue/sync_backend_host_impl.h index 4a65f467f9..b2ed9627cd 100644 --- a/chrome/browser/sync/glue/sync_backend_host_impl.h +++ b/chrome/browser/sync/glue/sync_backend_host_impl.h @@ -46,12 +46,15 @@ class NetworkResources; class SyncManagerFactory; } +namespace sync_driver { +class SyncPrefs; +} + namespace browser_sync { class ChangeProcessor; class SyncBackendHostCore; class SyncBackendRegistrar; -class SyncPrefs; class SyncedDeviceTracker; struct DoInitializeOptions; @@ -68,10 +71,9 @@ class SyncBackendHostImpl // it serves and communicates to via the SyncFrontend interface (on // the same thread it used to call the constructor). Must outlive // |sync_prefs|. - SyncBackendHostImpl( - const std::string& name, - Profile* profile, - const base::WeakPtr<SyncPrefs>& sync_prefs); + SyncBackendHostImpl(const std::string& name, + Profile* profile, + const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs); virtual ~SyncBackendHostImpl(); // SyncBackendHost implementation. @@ -280,7 +282,7 @@ class SyncBackendHostImpl bool initialized_; - const base::WeakPtr<SyncPrefs> sync_prefs_; + const base::WeakPtr<sync_driver::SyncPrefs> sync_prefs_; ExtensionsActivityMonitor extensions_activity_monitor_; diff --git a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc index 483d53b9dc..62553d15cb 100644 --- a/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc @@ -17,9 +17,9 @@ #include "chrome/browser/prefs/pref_service_syncable.h" #include "chrome/browser/sync/glue/device_info.h" #include "chrome/browser/sync/glue/synced_device_tracker.h" -#include "chrome/browser/sync/sync_prefs.h" #include "chrome/test/base/testing_profile.h" #include "components/sync_driver/sync_frontend.h" +#include "components/sync_driver/sync_prefs.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread_bundle.h" @@ -135,7 +135,7 @@ class SyncBackendHostTest : public testing::Test { virtual void SetUp() OVERRIDE { profile_.reset(new TestingProfile()); - sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs())); + sync_prefs_.reset(new sync_driver::SyncPrefs(profile_->GetPrefs())); backend_.reset(new SyncBackendHostImpl( profile_->GetDebugName(), profile_.get(), @@ -255,7 +255,7 @@ class SyncBackendHostTest : public testing::Test { StrictMock<MockSyncFrontend> mock_frontend_; syncer::SyncCredentials credentials_; scoped_ptr<TestingProfile> profile_; - scoped_ptr<SyncPrefs> sync_prefs_; + scoped_ptr<sync_driver::SyncPrefs> sync_prefs_; scoped_ptr<SyncBackendHost> backend_; scoped_ptr<FakeSyncManagerFactory> fake_manager_factory_; FakeSyncManager* fake_manager_; diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc index 258799939f..7a56c18c68 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -92,6 +92,22 @@ syncer::ModelSafeGroup TypedUrlDataTypeController::model_safe_group() return syncer::GROUP_HISTORY; } +void TypedUrlDataTypeController::LoadModels( + const ModelLoadCallback& model_load_callback) { + if (profile()->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) { + model_load_callback.Run( + type(), + syncer::SyncError(FROM_HERE, + syncer::SyncError::DATATYPE_ERROR, + "History sync disabled by policy.", + type())); + return; + } + + set_state(MODEL_LOADED); + model_load_callback.Run(type(), syncer::SyncError()); +} + void TypedUrlDataTypeController::SetBackend(history::HistoryBackend* backend) { DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); backend_ = backend; diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.h b/chrome/browser/sync/glue/typed_url_data_type_controller.h index 95b087b478..ce2a786387 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.h +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h @@ -34,6 +34,8 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController { // NonFrontendDataTypeController implementation virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; + virtual void LoadModels(const ModelLoadCallback& model_load_callback) + OVERRIDE; // Invoked on the history thread to set our history backend - must be called // before CreateSyncComponents() is invoked. |