Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4089)

Unified Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h

Issue 2731033002: [Media Router] Custom Controls 3 - add plumbing through MRUI and MRWebUIMessageHandler (Closed)
Patch Set: Address Derek's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
index 33a005be35870ac6a280e55c3c146faba172a787..de912f22ab70680a877b10ff655a051645e70d1d 100644
--- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
+++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/webui/media_router/media_cast_mode.h"
#include "chrome/browser/ui/webui/media_router/media_sink_with_cast_modes.h"
#include "chrome/common/media_router/issue.h"
+#include "chrome/common/media_router/media_status.h"
#include "components/signin/core/browser/account_info.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "ui/gfx/geometry/size.h"
@@ -56,6 +57,13 @@ class MediaRouterWebUIMessageHandler : public content::WebUIMessageHandler {
// the browser window changes.
void UpdateMaxDialogHeight(int height);
+ // Notifies the WebUI with an updated MediaStatus. Overridden in tests.
+ virtual void UpdateMediaRouteStatus(const MediaStatus& status);
+
+ // Notifies the WebUI that the controller for the selected route has been
+ // invalidated.
+ void OnRouteControllerInvalidated();
+
void SetWebUIForTest(content::WebUI* webui);
void set_incognito_for_test(bool incognito) { incognito_ = incognito; }
@@ -64,6 +72,10 @@ class MediaRouterWebUIMessageHandler : public content::WebUIMessageHandler {
RecordCastModeSelection);
FRIEND_TEST_ALL_PREFIXES(MediaRouterWebUIMessageHandlerTest,
RetrieveCastModeSelection);
+ FRIEND_TEST_ALL_PREFIXES(MediaRouterWebUIMessageHandlerTest,
+ OnRouteDetailsOpenedAndClosed);
+ FRIEND_TEST_ALL_PREFIXES(MediaRouterWebUIMessageHandlerTest,
+ OnMediaCommandsReceived);
// WebUIMessageHandler implementation.
void RegisterMessages() override;
@@ -89,9 +101,18 @@ class MediaRouterWebUIMessageHandler : public content::WebUIMessageHandler {
void OnReportSinkCount(const base::ListValue* args);
void OnReportTimeToClickSink(const base::ListValue* args);
void OnReportTimeToInitialActionClose(const base::ListValue* args);
+ void OnRouteDetailsClosed(const base::ListValue* args);
+ void OnRouteDetailsOpened(const base::ListValue* args);
void OnSearchSinksAndCreateRoute(const base::ListValue* args);
void OnInitialDataReceived(const base::ListValue* args);
+ // Handlers for JavaScript messages to control media routes.
+ void OnPlayRoute(const base::ListValue* args);
+ void OnPauseRoute(const base::ListValue* args);
+ void OnSeekRoute(const base::ListValue* args);
+ void OnSetRouteMute(const base::ListValue* args);
+ void OnSetRouteVolume(const base::ListValue* args);
+
// Performs an action for an Issue of |type|.
// |args| contains additional parameter that varies based on |type|.
// Returns |true| if the action was successfully performed.

Powered by Google App Engine
This is Rietveld 408576698