1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDLER_H_
8 #include "base/macros.h"
9 #include "content/public/browser/web_ui_message_handler.h"
15 namespace media_router
{
19 // The handler for Javascript messages related to the media router dialog.
20 class MediaRouterWebUIMessageHandler
: public content::WebUIMessageHandler
{
22 MediaRouterWebUIMessageHandler();
23 ~MediaRouterWebUIMessageHandler() override
;
25 // WebUIMessageHandler implementation.
26 void RegisterMessages() override
;
29 // Handlers for JavaScript messages.
30 void OnGetInitialSettings(const base::ListValue
* args
);
31 void OnCreateRoute(const base::ListValue
* args
);
32 void OnActOnIssue(const base::ListValue
* args
);
33 void OnCloseRoute(const base::ListValue
* args
);
34 void OnCloseDialog(const base::ListValue
* args
);
36 // Helper function for getting a pointer to the corresponding MediaRouterUI.
37 MediaRouterUI
* GetMediaRouterUI() const;
39 // Keeps track of whether a command to close the dialog has been issued.
42 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler
);
45 } // namespace media_router
47 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDLER_H_