| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDLER_
H_ | 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_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDLER_
H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 ~MediaRouterWebUIMessageHandler() override; | 37 ~MediaRouterWebUIMessageHandler() override; |
| 38 | 38 |
| 39 // Methods to update the status displayed by the dialog. | 39 // Methods to update the status displayed by the dialog. |
| 40 void UpdateSinks(const std::vector<MediaSinkWithCastModes>& sinks); | 40 void UpdateSinks(const std::vector<MediaSinkWithCastModes>& sinks); |
| 41 void UpdateRoutes(const std::vector<MediaRoute>& routes, | 41 void UpdateRoutes(const std::vector<MediaRoute>& routes, |
| 42 const std::vector<MediaRoute::Id>& joinable_route_ids); | 42 const std::vector<MediaRoute::Id>& joinable_route_ids); |
| 43 void UpdateCastModes(const CastModeSet& cast_modes, | 43 void UpdateCastModes(const CastModeSet& cast_modes, |
| 44 const std::string& source_host); | 44 const std::string& source_host); |
| 45 void OnCreateRouteResponseReceived(const MediaSink::Id& sink_id, | 45 void OnCreateRouteResponseReceived(const MediaSink::Id& sink_id, |
| 46 const MediaRoute* route); | 46 const MediaRoute* route); |
| 47 void ReturnSearchResult(const std::string& sink_id); |
| 47 | 48 |
| 48 // Does not take ownership of |issue|. Note that |issue| can be nullptr, when | 49 // Does not take ownership of |issue|. Note that |issue| can be nullptr, when |
| 49 // there are no more issues. | 50 // there are no more issues. |
| 50 void UpdateIssue(const Issue* issue); | 51 void UpdateIssue(const Issue* issue); |
| 51 | 52 |
| 52 // Updates the maximum dialog height to allow the WebUI properly scale when | 53 // Updates the maximum dialog height to allow the WebUI properly scale when |
| 53 // the browser window changes. | 54 // the browser window changes. |
| 54 void UpdateMaxDialogHeight(int height); | 55 void UpdateMaxDialogHeight(int height); |
| 55 | 56 |
| 56 void SetWebUIForTest(content::WebUI* webui); | 57 void SetWebUIForTest(content::WebUI* webui); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 73 void OnReportFilter(const base::ListValue* args); | 74 void OnReportFilter(const base::ListValue* args); |
| 74 void OnReportInitialAction(const base::ListValue* args); | 75 void OnReportInitialAction(const base::ListValue* args); |
| 75 void OnReportInitialState(const base::ListValue* args); | 76 void OnReportInitialState(const base::ListValue* args); |
| 76 void OnReportNavigateToView(const base::ListValue* args); | 77 void OnReportNavigateToView(const base::ListValue* args); |
| 77 void OnReportRouteCreation(const base::ListValue* args); | 78 void OnReportRouteCreation(const base::ListValue* args); |
| 78 void OnReportRouteCreationOutcome(const base::ListValue* args); | 79 void OnReportRouteCreationOutcome(const base::ListValue* args); |
| 79 void OnReportSelectedCastMode(const base::ListValue* args); | 80 void OnReportSelectedCastMode(const base::ListValue* args); |
| 80 void OnReportSinkCount(const base::ListValue* args); | 81 void OnReportSinkCount(const base::ListValue* args); |
| 81 void OnReportTimeToClickSink(const base::ListValue* args); | 82 void OnReportTimeToClickSink(const base::ListValue* args); |
| 82 void OnReportTimeToInitialActionClose(const base::ListValue* args); | 83 void OnReportTimeToInitialActionClose(const base::ListValue* args); |
| 84 void OnSearchSinksAndCreateRoute(const base::ListValue* args); |
| 83 void OnInitialDataReceived(const base::ListValue* args); | 85 void OnInitialDataReceived(const base::ListValue* args); |
| 84 | 86 |
| 85 // Performs an action for an Issue of |type|. | 87 // Performs an action for an Issue of |type|. |
| 86 // |args| contains additional parameter that varies based on |type|. | 88 // |args| contains additional parameter that varies based on |type|. |
| 87 // Returns |true| if the action was successfully performed. | 89 // Returns |true| if the action was successfully performed. |
| 88 bool ActOnIssueType(const IssueAction::Type& type, | 90 bool ActOnIssueType(const IssueAction::Type& type, |
| 89 const base::DictionaryValue* args); | 91 const base::DictionaryValue* args); |
| 90 | 92 |
| 91 // May update the first run flow related properties in the WebUI. This is | 93 // May update the first run flow related properties in the WebUI. This is |
| 92 // called after the initial data is received to avoid unnecessary work when | 94 // called after the initial data is received to avoid unnecessary work when |
| 93 // initializing the WebUI. | 95 // initializing the WebUI. |
| 94 void MaybeUpdateFirstRunFlowData(); | 96 void MaybeUpdateFirstRunFlowData(); |
| 95 | 97 |
| 96 // Retrieve the account info for email and domain of signed in users. This is | 98 // Retrieve the account info for email and domain of signed in users. This is |
| 97 // used when updating sinks to determine if identity should be displayed. | 99 // used when updating sinks to determine if identity should be displayed. |
| 98 // Marked virtual for tests. | 100 // Marked virtual for tests. |
| 99 virtual AccountInfo GetAccountInfo(); | 101 virtual AccountInfo GetAccountInfo(); |
| 100 | 102 |
| 101 // Keeps track of whether a command to close the dialog has been issued. | 103 // Keeps track of whether a command to close the dialog has been issued. |
| 102 bool dialog_closing_; | 104 bool dialog_closing_; |
| 103 | 105 |
| 104 MediaRouterUI* media_router_ui_; | 106 MediaRouterUI* media_router_ui_; |
| 105 | 107 |
| 106 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler); | 108 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler); |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 } // namespace media_router | 111 } // namespace media_router |
| 110 | 112 |
| 111 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDL
ER_H_ | 113 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDL
ER_H_ |
| OLD | NEW |