| OLD | NEW |
| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 public browser_sync::ProtocolEventObserver { | 30 public browser_sync::ProtocolEventObserver { |
| 31 public: | 31 public: |
| 32 SyncInternalsMessageHandler(); | 32 SyncInternalsMessageHandler(); |
| 33 virtual ~SyncInternalsMessageHandler(); | 33 virtual ~SyncInternalsMessageHandler(); |
| 34 | 34 |
| 35 virtual void RegisterMessages() OVERRIDE; | 35 virtual void RegisterMessages() OVERRIDE; |
| 36 | 36 |
| 37 // Forwards requests to the JsController. | 37 // Forwards requests to the JsController. |
| 38 void ForwardToJsController(const std::string& name, const base::ListValue*); | 38 void ForwardToJsController(const std::string& name, const base::ListValue*); |
| 39 | 39 |
| 40 // Sets up observers to receive events and forward them to the UI. |
| 41 void HandleRegisterForEvents(const base::ListValue* args); |
| 42 |
| 40 // Fires an event to send updated info back to the page. | 43 // Fires an event to send updated info back to the page. |
| 41 void HandleRequestUpdatedAboutInfo(const base::ListValue* args); | 44 void HandleRequestUpdatedAboutInfo(const base::ListValue* args); |
| 42 | 45 |
| 43 // Fires and event to send the list of types back to the page. | 46 // Fires and event to send the list of types back to the page. |
| 44 void HandleRequestListOfTypes(const base::ListValue* args); | 47 void HandleRequestListOfTypes(const base::ListValue* args); |
| 45 | 48 |
| 46 // syncer::JsEventHandler implementation. | 49 // syncer::JsEventHandler implementation. |
| 47 virtual void HandleJsEvent( | 50 virtual void HandleJsEvent( |
| 48 const std::string& name, | 51 const std::string& name, |
| 49 const syncer::JsEventDetails& details) OVERRIDE; | 52 const syncer::JsEventDetails& details) OVERRIDE; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 | 72 |
| 70 ProfileSyncService* GetProfileSyncService(); | 73 ProfileSyncService* GetProfileSyncService(); |
| 71 | 74 |
| 72 base::WeakPtr<syncer::JsController> js_controller_; | 75 base::WeakPtr<syncer::JsController> js_controller_; |
| 73 base::WeakPtrFactory<SyncInternalsMessageHandler> weak_ptr_factory_; | 76 base::WeakPtrFactory<SyncInternalsMessageHandler> weak_ptr_factory_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(SyncInternalsMessageHandler); | 78 DISALLOW_COPY_AND_ASSIGN(SyncInternalsMessageHandler); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_ | 81 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_MESSAGE_HANDLER_H_ |
| OLD | NEW |