Index: chrome/browser/ui/webui/sync_internals_message_handler.h |
diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.h b/chrome/browser/ui/webui/sync_internals_message_handler.h |
index 5b652d5627ade67284270dda9fa7a8503d0bb108..8253acdeecca03c15e380ab34414f56bb0ba4aa6 100644 |
--- a/chrome/browser/ui/webui/sync_internals_message_handler.h |
+++ b/chrome/browser/ui/webui/sync_internals_message_handler.h |
@@ -11,6 +11,7 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/weak_ptr.h" |
#include "base/values.h" |
+#include "chrome/browser/sync/profile_sync_service_observer.h" |
#include "content/public/browser/web_ui_message_handler.h" |
#include "sync/js/js_controller.h" |
#include "sync/js/js_event_handler.h" |
@@ -22,16 +23,22 @@ class ProfileSyncService; |
class SyncInternalsMessageHandler |
: public content::WebUIMessageHandler, |
public syncer::JsEventHandler, |
- public syncer::JsReplyHandler { |
+ public syncer::JsReplyHandler, |
+ public ProfileSyncServiceObserver { |
public: |
SyncInternalsMessageHandler(); |
virtual ~SyncInternalsMessageHandler(); |
virtual void RegisterMessages() OVERRIDE; |
+ // Forwards requests to the JsController. |
void ForwardToJsController(const std::string& name, const base::ListValue*); |
- void OnGetAboutInfo(const base::ListValue*); |
- void OnGetListOfTypes(const base::ListValue*); |
+ |
+ // Fires an event to send updated info back to the page. |
+ void HandleRequestUpdatedAboutInfo(const base::ListValue* args); |
+ |
+ // Fires and event to send the list of types back to the page. |
+ void HandleRequestListOfTypes(const base::ListValue* args); |
// syncer::JsEventHandler implementation. |
virtual void HandleJsEvent( |
@@ -43,8 +50,17 @@ class SyncInternalsMessageHandler |
const std::string& name, |
const syncer::JsArgList& args) OVERRIDE; |
+ // ProfileSyncServiceObserver implementation. |
+ virtual void OnStateChanged() OVERRIDE; |
+ |
private: |
+ // Helper function to register JsController function callbacks. |
void RegisterJsControllerCallback(const std::string& name); |
+ |
+ // Fetches updated aboutInfo and sends it to the page in the form of an |
+ // onAboutInfoUpdated event. |
+ void SendAboutInfo(); |
+ |
ProfileSyncService* GetProfileSyncService(); |
base::WeakPtr<syncer::JsController> js_controller_; |