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

Side by Side Diff: chrome/browser/sync/js/js_sync_manager_observer.cc

Issue 8356026: [Sync] Cache encrypted types info in ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failures Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/js/js_sync_manager_observer.h" 5 #include "chrome/browser/sync/js/js_sync_manager_observer.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const std::string& bootstrap_token) { 74 const std::string& bootstrap_token) {
75 if (!event_handler_.IsInitialized()) { 75 if (!event_handler_.IsInitialized()) {
76 return; 76 return;
77 } 77 }
78 DictionaryValue details; 78 DictionaryValue details;
79 details.SetString("bootstrapToken", "<redacted>"); 79 details.SetString("bootstrapToken", "<redacted>");
80 HandleJsEvent(FROM_HERE, "onPassphraseAccepted", JsEventDetails(&details)); 80 HandleJsEvent(FROM_HERE, "onPassphraseAccepted", JsEventDetails(&details));
81 } 81 }
82 82
83 void JsSyncManagerObserver::OnEncryptionComplete( 83 void JsSyncManagerObserver::OnEncryptionComplete(
84 const syncable::ModelTypeSet& encrypted_types) { 84 const syncable::ModelTypeSet& encrypted_types,
85 bool encrypt_everything) {
85 if (!event_handler_.IsInitialized()) { 86 if (!event_handler_.IsInitialized()) {
86 return; 87 return;
87 } 88 }
88 DictionaryValue details; 89 DictionaryValue details;
89 details.Set("encryptedTypes", 90 details.Set("encryptedTypes",
90 syncable::ModelTypeSetToValue(encrypted_types)); 91 syncable::ModelTypeSetToValue(encrypted_types));
92 details.SetBoolean("encryptEverything", encrypt_everything);
91 HandleJsEvent(FROM_HERE, "onEncryptionComplete", JsEventDetails(&details)); 93 HandleJsEvent(FROM_HERE, "onEncryptionComplete", JsEventDetails(&details));
92 } 94 }
93 95
94 void JsSyncManagerObserver::OnActionableError( 96 void JsSyncManagerObserver::OnActionableError(
95 const SyncProtocolError& sync_error) { 97 const SyncProtocolError& sync_error) {
96 if (!event_handler_.IsInitialized()) { 98 if (!event_handler_.IsInitialized()) {
97 return; 99 return;
98 } 100 }
99 DictionaryValue details; 101 DictionaryValue details;
100 details.Set("syncError", sync_error.ToValue()); 102 details.Set("syncError", sync_error.ToValue());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const std::string& name, const JsEventDetails& details) { 141 const std::string& name, const JsEventDetails& details) {
140 if (!event_handler_.IsInitialized()) { 142 if (!event_handler_.IsInitialized()) {
141 NOTREACHED(); 143 NOTREACHED();
142 return; 144 return;
143 } 145 }
144 event_handler_.Call(from_here, 146 event_handler_.Call(from_here,
145 &JsEventHandler::HandleJsEvent, name, details); 147 &JsEventHandler::HandleJsEvent, name, details);
146 } 148 }
147 149
148 } // namespace browser_sync 150 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698