OLD | NEW |
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 Loading... |
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::OnEncryptedTypesChanged( | 83 void JsSyncManagerObserver::OnEncryptedTypesChanged( |
84 syncable::ModelEnumSet encrypted_types, | 84 syncable::ModelTypeSet encrypted_types, |
85 bool encrypt_everything) { | 85 bool encrypt_everything) { |
86 if (!event_handler_.IsInitialized()) { | 86 if (!event_handler_.IsInitialized()) { |
87 return; | 87 return; |
88 } | 88 } |
89 DictionaryValue details; | 89 DictionaryValue details; |
90 details.Set("encryptedTypes", | 90 details.Set("encryptedTypes", |
91 syncable::ModelEnumSetToValue(encrypted_types)); | 91 syncable::ModelTypeSetToValue(encrypted_types)); |
92 details.SetBoolean("encryptEverything", encrypt_everything); | 92 details.SetBoolean("encryptEverything", encrypt_everything); |
93 HandleJsEvent(FROM_HERE, | 93 HandleJsEvent(FROM_HERE, |
94 "onEncryptedTypesChanged", JsEventDetails(&details)); | 94 "onEncryptedTypesChanged", JsEventDetails(&details)); |
95 } | 95 } |
96 | 96 |
97 void JsSyncManagerObserver::OnEncryptionComplete() { | 97 void JsSyncManagerObserver::OnEncryptionComplete() { |
98 if (!event_handler_.IsInitialized()) { | 98 if (!event_handler_.IsInitialized()) { |
99 return; | 99 return; |
100 } | 100 } |
101 DictionaryValue details; | 101 DictionaryValue details; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 const std::string& name, const JsEventDetails& details) { | 150 const std::string& name, const JsEventDetails& details) { |
151 if (!event_handler_.IsInitialized()) { | 151 if (!event_handler_.IsInitialized()) { |
152 NOTREACHED(); | 152 NOTREACHED(); |
153 return; | 153 return; |
154 } | 154 } |
155 event_handler_.Call(from_here, | 155 event_handler_.Call(from_here, |
156 &JsEventHandler::HandleJsEvent, name, details); | 156 &JsEventHandler::HandleJsEvent, name, details); |
157 } | 157 } |
158 | 158 |
159 } // namespace browser_sync | 159 } // namespace browser_sync |
OLD | NEW |