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

Unified Diff: chrome/browser/sync/glue/app_model_associator.cc

Issue 7564037: Apps/Extensions Sync refactoring -- delete most of the old glue, implement new sync API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Release build warning :-/ Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/app_model_associator.cc
diff --git a/chrome/browser/sync/glue/app_model_associator.cc b/chrome/browser/sync/glue/app_model_associator.cc
deleted file mode 100644
index 1130e6a781ea0baaf4fd533e7802c09f32fca667..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/glue/app_model_associator.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/sync/glue/app_model_associator.h"
-
-#include "base/logging.h"
-#include "base/tracked.h"
-#include "chrome/browser/extensions/extension_sync_data.h"
-#include "chrome/browser/sync/api/sync_error.h"
-#include "chrome/browser/sync/glue/extension_sync.h"
-#include "chrome/browser/sync/glue/extension_sync_traits.h"
-#include "chrome/browser/sync/glue/extension_sync_traits.h"
-#include "chrome/browser/sync/internal_api/read_transaction.h"
-#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/protocol/extension_specifics.pb.h"
-#include "content/browser/browser_thread.h"
-
-namespace browser_sync {
-
-AppModelAssociator::AppModelAssociator(
- ExtensionServiceInterface* extension_service,
- sync_api::UserShare* user_share)
- : traits_(GetAppSyncTraits()), extension_service_(extension_service),
- user_share_(user_share) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(extension_service_);
- DCHECK(user_share_);
-}
-
-AppModelAssociator::~AppModelAssociator() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-}
-
-bool AppModelAssociator::AssociateModels(SyncError* error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- ExtensionDataMap extension_data_map;
- if (!SlurpExtensionData(
- traits_, *extension_service_, user_share_, &extension_data_map)) {
- error->Reset(FROM_HERE, "Failed to get app data.", model_type());
- return false;
- }
- if (!FlushExtensionData(
- traits_, extension_data_map, extension_service_, user_share_)) {
- error->Reset(FROM_HERE, "Failed to flush app data.", model_type());
- return false;
- }
-
- return true;
-}
-
-bool AppModelAssociator::DisassociateModels(SyncError* error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // Nothing to do.
- return true;
-}
-
-bool AppModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- return RootNodeHasChildren(traits_.root_node_tag, user_share_, has_nodes);
-}
-
-void AppModelAssociator::AbortAssociation() {
- // No implementation needed, this associator runs on the main
- // thread.
-}
-
-bool AppModelAssociator::CryptoReadyIfNecessary() {
- // We only access the cryptographer while holding a transaction.
- sync_api::ReadTransaction trans(FROM_HERE, user_share_);
- const syncable::ModelTypeSet& encrypted_types =
- sync_api::GetEncryptedTypes(&trans);
- return encrypted_types.count(traits_.model_type) == 0 ||
- trans.GetCryptographer()->is_ready();
-}
-
-} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/app_model_associator.h ('k') | chrome/browser/sync/glue/extension_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698