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

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

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 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
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_JS_JS_SYNC_MANAGER_OBSERVER_H_
6 #define CHROME_BROWSER_SYNC_JS_JS_SYNC_MANAGER_OBSERVER_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "chrome/browser/sync/internal_api/sync_manager.h"
14 #include "chrome/browser/sync/protocol/sync_protocol_error.h"
15 #include "chrome/browser/sync/util/weak_handle.h"
16
17 namespace tracked_objects {
18 class Location;
19 } // namespace tracked_objects
20
21 namespace browser_sync {
22
23 class JsEventDetails;
24 class JsEventHandler;
25
26 // Routes SyncManager events to a JsEventHandler.
27 class JsSyncManagerObserver : public sync_api::SyncManager::Observer {
28 public:
29 JsSyncManagerObserver();
30 virtual ~JsSyncManagerObserver();
31
32 void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler);
33
34 // sync_api::SyncManager::Observer implementation.
35 virtual void OnSyncCycleCompleted(
36 const sessions::SyncSessionSnapshot* snapshot) OVERRIDE;
37 virtual void OnConnectionStatusChange(
38 sync_api::ConnectionStatus status) OVERRIDE;
39 virtual void OnUpdatedToken(const std::string& token) OVERRIDE;
40 virtual void OnPassphraseRequired(
41 sync_api::PassphraseRequiredReason reason,
42 const sync_pb::EncryptedData& pending_keys) OVERRIDE;
43 virtual void OnPassphraseAccepted() OVERRIDE;
44 virtual void OnBootstrapTokenUpdated(
45 const std::string& bootstrap_token) OVERRIDE;
46 virtual void OnEncryptedTypesChanged(
47 syncable::ModelTypeSet encrypted_types,
48 bool encrypt_everything) OVERRIDE;
49 virtual void OnEncryptionComplete() OVERRIDE;
50 virtual void OnInitializationComplete(
51 const WeakHandle<JsBackend>& js_backend, bool success) OVERRIDE;
52 virtual void OnStopSyncingPermanently() OVERRIDE;
53 virtual void OnClearServerDataSucceeded() OVERRIDE;
54 virtual void OnClearServerDataFailed() OVERRIDE;
55 virtual void OnActionableError(
56 const browser_sync::SyncProtocolError& sync_protocol_error) OVERRIDE;
57
58 private:
59 void HandleJsEvent(const tracked_objects::Location& from_here,
60 const std::string& name, const JsEventDetails& details);
61
62 WeakHandle<JsEventHandler> event_handler_;
63
64 DISALLOW_COPY_AND_ASSIGN(JsSyncManagerObserver);
65 };
66
67 } // namespace browser_sync
68
69 #endif // CHROME_BROWSER_SYNC_JS_JS_SYNC_MANAGER_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/js/js_reply_handler.h ('k') | chrome/browser/sync/js/js_sync_manager_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698