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

Side by Side Diff: chrome/browser/sync/glue/session_model_associator.cc

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/glue/session_model_associator.h" 5 #include "chrome/browser/sync/glue/session_model_associator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/threading/sequenced_worker_pool.h" 15 #include "base/threading/sequenced_worker_pool.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "chrome/browser/favicon/favicon_service_factory.h" 17 #include "chrome/browser/favicon/favicon_service_factory.h"
18 #include "chrome/browser/history/history_service.h" 18 #include "chrome/browser/history/history_service.h"
19 #include "chrome/browser/prefs/pref_registry_syncable.h"
20 #include "chrome/browser/prefs/pref_service_syncable.h" 19 #include "chrome/browser/prefs/pref_service_syncable.h"
21 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/sessions/session_id.h" 21 #include "chrome/browser/sessions/session_id.h"
23 #include "chrome/browser/sync/glue/device_info.h" 22 #include "chrome/browser/sync/glue/device_info.h"
24 #include "chrome/browser/sync/glue/synced_device_tracker.h" 23 #include "chrome/browser/sync/glue/synced_device_tracker.h"
25 #include "chrome/browser/sync/glue/synced_session.h" 24 #include "chrome/browser/sync/glue/synced_session.h"
26 #include "chrome/browser/sync/glue/synced_tab_delegate.h" 25 #include "chrome/browser/sync/glue/synced_tab_delegate.h"
27 #include "chrome/browser/sync/glue/synced_window_delegate.h" 26 #include "chrome/browser/sync/glue/synced_window_delegate.h"
28 #include "chrome/browser/sync/profile_sync_service.h" 27 #include "chrome/browser/sync/profile_sync_service.h"
29 #include "chrome/common/chrome_notification_types.h" 28 #include "chrome/common/chrome_notification_types.h"
30 #include "chrome/common/chrome_switches.h" 29 #include "chrome/common/chrome_switches.h"
31 #include "chrome/common/pref_names.h" 30 #include "chrome/common/pref_names.h"
32 #include "chrome/common/url_constants.h" 31 #include "chrome/common/url_constants.h"
32 #include "components/user_prefs/pref_registry_syncable.h"
33 #include "content/public/browser/navigation_entry.h" 33 #include "content/public/browser/navigation_entry.h"
34 #include "content/public/browser/notification_details.h" 34 #include "content/public/browser/notification_details.h"
35 #include "content/public/browser/notification_service.h" 35 #include "content/public/browser/notification_service.h"
36 #include "sync/api/sync_error.h" 36 #include "sync/api/sync_error.h"
37 #include "sync/api/time.h" 37 #include "sync/api/time.h"
38 #include "sync/internal_api/public/base/model_type.h" 38 #include "sync/internal_api/public/base/model_type.h"
39 #include "sync/internal_api/public/base/model_type_invalidation_map.h" 39 #include "sync/internal_api/public/base/model_type_invalidation_map.h"
40 #include "sync/internal_api/public/read_node.h" 40 #include "sync/internal_api/public/read_node.h"
41 #include "sync/internal_api/public/read_transaction.h" 41 #include "sync/internal_api/public/read_transaction.h"
42 #include "sync/internal_api/public/write_node.h" 42 #include "sync/internal_api/public/write_node.h"
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 1253
1254 bool SessionModelAssociator::CryptoReadyIfNecessary() { 1254 bool SessionModelAssociator::CryptoReadyIfNecessary() {
1255 // We only access the cryptographer while holding a transaction. 1255 // We only access the cryptographer while holding a transaction.
1256 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); 1256 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
1257 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); 1257 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes();
1258 return !encrypted_types.Has(SESSIONS) || 1258 return !encrypted_types.Has(SESSIONS) ||
1259 sync_service_->IsCryptographerReady(&trans); 1259 sync_service_->IsCryptographerReady(&trans);
1260 } 1260 }
1261 1261
1262 } // namespace browser_sync 1262 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698