blob: 4c6ca5a6b2af31252dfea422c241e6fee74bf53c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_
#define CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_
#pragma once
#include <string>
#include "base/compiler_specific.h"
#include "base/basictypes.h"
#include "chrome/browser/sync/js_event_handler.h"
#include "chrome/browser/ui/webui/chrome_web_ui.h"
namespace browser_sync {
class JsFrontend;
} // namespace browser_sync
// The implementation for the chrome://sync-internals page.
class SyncInternalsUI : public ChromeWebUI,
public browser_sync::JsEventHandler {
public:
explicit SyncInternalsUI(TabContents* contents);
virtual ~SyncInternalsUI();
// WebUI implementation.
//
// The following messages are processed:
//
// getAboutInfo():
// Immediately fires a onGetAboutInfoFinished() event with a
// dictionary of sync-related stats and info.
//
// All other messages are routed to the sync service if it exists,
// and dropped otherwise.
//
// TODO(akalin): Add a simple isSyncEnabled() message and make
// getAboutInfo() be handled by the sync service.
virtual void OnWebUISend(const GURL& source_url,
const std::string& name,
const ListValue& args) OVERRIDE;
// browser_sync::JsEventHandler implementation.
virtual void HandleJsEvent(
const std::string& name,
const browser_sync::JsEventDetails& details) OVERRIDE;
virtual void HandleJsMessageReply(
const std::string& name,
const browser_sync::JsArgList& args) OVERRIDE;
private:
// Returns the sync service's JsFrontend object, or NULL if the sync
// service does not exist.
browser_sync::JsFrontend* GetJsFrontend();
DISALLOW_COPY_AND_ASSIGN(SyncInternalsUI);
};
#endif // CHROME_BROWSER_UI_WEBUI_SYNC_INTERNALS_UI_H_
|