Chromium Code Reviews| Index: chrome/browser/ui/webui/copresence_ui_handler.h |
| diff --git a/chrome/browser/ui/webui/copresence_ui_handler.h b/chrome/browser/ui/webui/copresence_ui_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9c1224d8d6a43bfa74948ca5cda2f47baf4a790a |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/copresence_ui_handler.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2014 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_COPRESENCE_UI_HANDLER_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_COPRESENCE_UI_HANDLER_H_ |
| + |
| +#include <vector> |
|
Dan Beam
2014/12/09 05:33:39
unused?
Charlie
2014/12/17 23:39:56
Yep. Nixed.
|
| + |
| +#include "base/macros.h" |
| +#include "components/copresence/public/copresence_observer.h" |
| +#include "content/public/browser/web_ui_message_handler.h" |
| + |
| +namespace base { |
| +class ListValue; |
| +} |
| + |
| +namespace content { |
| +class WebUI; |
| +} |
| + |
| +namespace copresence { |
| +class CopresenceState; |
| +} |
| + |
| +// UI Handler for the copresence page. |
| +// TODO(ckehoe): Write tests. |
|
Dan Beam
2014/12/09 05:33:39
why not just write the tests?
Charlie
2014/12/17 23:39:56
Haha. You haven't worked with my manager :-)
This
Dan Beam
2014/12/20 00:10:29
i'd just do this todo or remove it as it's a waste
Charlie
2014/12/20 02:04:51
Not only do I plan to do it, but I can tell you th
|
| +class CopresenceUIHandler final : public content::WebUIMessageHandler, |
| + public copresence::CopresenceObserver { |
| + public: |
| + explicit CopresenceUIHandler(content::WebUI* web_ui); |
| + ~CopresenceUIHandler() override; |
| + |
| + private: |
| + // WebUIMessageHandler override. |
| + void RegisterMessages() override; |
| + |
| + // CopresenceObserver overrides. |
| + void DirectivesUpdated() override; |
| + void TokenSent(const copresence::SentToken& token) override; |
| + void TokenReceived(const copresence::ReceivedToken& token) override; |
| + |
| + // Handler to populate the page with its initial state. |
| + void HandlePopulateState(const base::ListValue* args); |
| + |
| + copresence::CopresenceState* state_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CopresenceUIHandler); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_COPRESENCE_UI_HANDLER_H_ |