OLD | NEW |
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 #ifndef SYNC_INTERNAL_API_JS_SYNC_ENCRYPTION_HANDLER_OBSERVER_H_ | 5 #ifndef SYNC_INTERNAL_API_JS_SYNC_ENCRYPTION_HANDLER_OBSERVER_H_ |
6 #define SYNC_INTERNAL_API_JS_SYNC_ENCRYPTION_HANDLER_OBSERVER_H_ | 6 #define SYNC_INTERNAL_API_JS_SYNC_ENCRYPTION_HANDLER_OBSERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace syncer { | 21 namespace syncer { |
22 | 22 |
23 class JsEventDetails; | 23 class JsEventDetails; |
24 class JsEventHandler; | 24 class JsEventHandler; |
25 | 25 |
26 // Routes SyncEncryptionHandler events to a JsEventHandler. | 26 // Routes SyncEncryptionHandler events to a JsEventHandler. |
27 class SYNC_EXPORT_PRIVATE JsSyncEncryptionHandlerObserver | 27 class SYNC_EXPORT_PRIVATE JsSyncEncryptionHandlerObserver |
28 : public SyncEncryptionHandler::Observer { | 28 : public SyncEncryptionHandler::Observer { |
29 public: | 29 public: |
30 JsSyncEncryptionHandlerObserver(); | 30 JsSyncEncryptionHandlerObserver(); |
31 virtual ~JsSyncEncryptionHandlerObserver(); | 31 ~JsSyncEncryptionHandlerObserver() override; |
32 | 32 |
33 void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler); | 33 void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler); |
34 | 34 |
35 // SyncEncryptionHandlerObserver::Observer implementation. | 35 // SyncEncryptionHandlerObserver::Observer implementation. |
36 virtual void OnPassphraseRequired( | 36 void OnPassphraseRequired( |
37 PassphraseRequiredReason reason, | 37 PassphraseRequiredReason reason, |
38 const sync_pb::EncryptedData& pending_keys) override; | 38 const sync_pb::EncryptedData& pending_keys) override; |
39 virtual void OnPassphraseAccepted() override; | 39 void OnPassphraseAccepted() override; |
40 virtual void OnBootstrapTokenUpdated( | 40 void OnBootstrapTokenUpdated(const std::string& bootstrap_token, |
41 const std::string& bootstrap_token, | 41 BootstrapTokenType type) override; |
42 BootstrapTokenType type) override; | 42 void OnEncryptedTypesChanged(ModelTypeSet encrypted_types, |
43 virtual void OnEncryptedTypesChanged( | 43 bool encrypt_everything) override; |
44 ModelTypeSet encrypted_types, | 44 void OnEncryptionComplete() override; |
45 bool encrypt_everything) override; | 45 void OnCryptographerStateChanged(Cryptographer* cryptographer) override; |
46 virtual void OnEncryptionComplete() override; | 46 void OnPassphraseTypeChanged(PassphraseType type, |
47 virtual void OnCryptographerStateChanged( | 47 base::Time explicit_passphrase_time) override; |
48 Cryptographer* cryptographer) override; | |
49 virtual void OnPassphraseTypeChanged( | |
50 PassphraseType type, | |
51 base::Time explicit_passphrase_time) override; | |
52 | 48 |
53 private: | 49 private: |
54 void HandleJsEvent(const tracked_objects::Location& from_here, | 50 void HandleJsEvent(const tracked_objects::Location& from_here, |
55 const std::string& name, const JsEventDetails& details); | 51 const std::string& name, const JsEventDetails& details); |
56 | 52 |
57 WeakHandle<JsEventHandler> event_handler_; | 53 WeakHandle<JsEventHandler> event_handler_; |
58 | 54 |
59 DISALLOW_COPY_AND_ASSIGN(JsSyncEncryptionHandlerObserver); | 55 DISALLOW_COPY_AND_ASSIGN(JsSyncEncryptionHandlerObserver); |
60 }; | 56 }; |
61 | 57 |
62 } // namespace syncer | 58 } // namespace syncer |
63 | 59 |
64 #endif // SYNC_INTERNAL_API_JS_SYNC_ENCRYPTION_HANDLER_OBSERVER_H_ | 60 #endif // SYNC_INTERNAL_API_JS_SYNC_ENCRYPTION_HANDLER_OBSERVER_H_ |
OLD | NEW |