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

Side by Side Diff: chrome/browser/ui/webui/sync_internals_message_handler.h

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/scoped_observer.h" 14 #include "base/scoped_observer.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "components/sync/driver/protocol_event_observer.h" 16 #include "components/sync/driver/protocol_event_observer.h"
17 #include "components/sync/driver/sync_service_observer.h" 17 #include "components/sync/driver/sync_service_observer.h"
18 #include "components/sync/engine/cycle/type_debug_info_observer.h" 18 #include "components/sync/engine/cycle/type_debug_info_observer.h"
19 #include "components/sync/js/js_controller.h" 19 #include "components/sync/js/js_controller.h"
20 #include "components/sync/js/js_event_handler.h" 20 #include "components/sync/js/js_event_handler.h"
21 #include "content/public/browser/web_ui_message_handler.h" 21 #include "content/public/browser/web_ui_message_handler.h"
22 22
23 class SigninManagerBase; 23 class SigninManagerBase;
24 24
25 namespace browser_sync { 25 namespace browser_sync {
26 class ProfileSyncService; 26 class ProfileSyncService;
27 } // namespace browser_sync 27 } // namespace browser_sync
28 28
29 namespace syncer { 29 namespace sync_driver {
30 class SyncService; 30 class SyncService;
31 } // namespace syncer 31 } // namespace sync_driver
32 32
33 // Interface to abstract away the creation of the about-sync value dictionary. 33 // Interface to abstract away the creation of the about-sync value dictionary.
34 class AboutSyncDataExtractor { 34 class AboutSyncDataExtractor {
35 public: 35 public:
36 // Given state about sync, extracts various interesting fields and populates 36 // Given state about sync, extracts various interesting fields and populates
37 // a tree of base::Value objects. 37 // a tree of base::Value objects.
38 virtual std::unique_ptr<base::DictionaryValue> ConstructAboutInformation( 38 virtual std::unique_ptr<base::DictionaryValue> ConstructAboutInformation(
39 syncer::SyncService* service, 39 sync_driver::SyncService* service,
40 SigninManagerBase* signin) = 0; 40 SigninManagerBase* signin) = 0;
41 virtual ~AboutSyncDataExtractor() {} 41 virtual ~AboutSyncDataExtractor() {}
42 }; 42 };
43 43
44 // The implementation for the chrome://sync-internals page. 44 // The implementation for the chrome://sync-internals page.
45 class SyncInternalsMessageHandler : public content::WebUIMessageHandler, 45 class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
46 public syncer::JsEventHandler, 46 public syncer::JsEventHandler,
47 public syncer::SyncServiceObserver, 47 public sync_driver::SyncServiceObserver,
48 public syncer::ProtocolEventObserver, 48 public browser_sync::ProtocolEventObserver,
49 public syncer::TypeDebugInfoObserver { 49 public syncer::TypeDebugInfoObserver {
50 public: 50 public:
51 SyncInternalsMessageHandler(); 51 SyncInternalsMessageHandler();
52 ~SyncInternalsMessageHandler() override; 52 ~SyncInternalsMessageHandler() override;
53 53
54 void RegisterMessages() override; 54 void RegisterMessages() override;
55 55
56 // Sets up observers to receive events and forward them to the UI. 56 // Sets up observers to receive events and forward them to the UI.
57 void HandleRegisterForEvents(const base::ListValue* args); 57 void HandleRegisterForEvents(const base::ListValue* args);
58 58
(...skipping 10 matching lines...) Expand all
69 void HandleGetAllNodes(const base::ListValue* args); 69 void HandleGetAllNodes(const base::ListValue* args);
70 70
71 // syncer::JsEventHandler implementation. 71 // syncer::JsEventHandler implementation.
72 void HandleJsEvent(const std::string& name, 72 void HandleJsEvent(const std::string& name,
73 const syncer::JsEventDetails& details) override; 73 const syncer::JsEventDetails& details) override;
74 74
75 // Callback used in GetAllNodes. 75 // Callback used in GetAllNodes.
76 void OnReceivedAllNodes(int request_id, 76 void OnReceivedAllNodes(int request_id,
77 std::unique_ptr<base::ListValue> nodes); 77 std::unique_ptr<base::ListValue> nodes);
78 78
79 // syncer::SyncServiceObserver implementation. 79 // sync_driver::SyncServiceObserver implementation.
80 void OnStateChanged() override; 80 void OnStateChanged() override;
81 81
82 // ProtocolEventObserver implementation. 82 // ProtocolEventObserver implementation.
83 void OnProtocolEvent(const syncer::ProtocolEvent& e) override; 83 void OnProtocolEvent(const syncer::ProtocolEvent& e) override;
84 84
85 // TypeDebugInfoObserver implementation. 85 // TypeDebugInfoObserver implementation.
86 void OnCommitCountersUpdated(syncer::ModelType type, 86 void OnCommitCountersUpdated(syncer::ModelType type,
87 const syncer::CommitCounters& counters) override; 87 const syncer::CommitCounters& counters) override;
88 void OnUpdateCountersUpdated(syncer::ModelType type, 88 void OnUpdateCountersUpdated(syncer::ModelType type,
89 const syncer::UpdateCounters& counters) override; 89 const syncer::UpdateCounters& counters) override;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 // An abstraction of who creates the about sync info value map. 123 // An abstraction of who creates the about sync info value map.
124 std::unique_ptr<AboutSyncDataExtractor> about_sync_data_extractor_; 124 std::unique_ptr<AboutSyncDataExtractor> about_sync_data_extractor_;
125 125
126 base::WeakPtrFactory<SyncInternalsMessageHandler> weak_ptr_factory_; 126 base::WeakPtrFactory<SyncInternalsMessageHandler> weak_ptr_factory_;
127 127
128 DISALLOW_COPY_AND_ASSIGN(SyncInternalsMessageHandler); 128 DISALLOW_COPY_AND_ASSIGN(SyncInternalsMessageHandler);
129 }; 129 };
130 130
131 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_ 131 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698