| 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 30 matching lines...) Expand all Loading... |
| 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 const std::unordered_map<MediaRoute::Id, MediaCastMode>& | 43 const std::unordered_map<MediaRoute::Id, MediaCastMode>& |
| 44 current_cast_modes); | 44 current_cast_modes); |
| 45 void UpdateCastModes(const CastModeSet& cast_modes, | 45 void UpdateCastModes(const CastModeSet& cast_modes, |
| 46 const std::string& source_host); | 46 const std::string& source_host); |
| 47 void OnCreateRouteResponseReceived(const MediaSink::Id& sink_id, | 47 void OnCreateRouteResponseReceived(const MediaSink::Id& sink_id, |
| 48 const MediaRoute* route); | 48 const MediaRoute* route); |
| 49 void ReturnSearchResult(const std::string& sink_id); | 49 void ReturnSearchResult(const std::string& sink_id); |
| 50 | 50 |
| 51 // Does not take ownership of |issue|. Note that |issue| can be nullptr, when | 51 void UpdateIssue(const Issue& issue); |
| 52 // there are no more issues. | 52 void ClearIssue(); |
| 53 void UpdateIssue(const Issue* issue); | |
| 54 | 53 |
| 55 // Updates the maximum dialog height to allow the WebUI properly scale when | 54 // Updates the maximum dialog height to allow the WebUI properly scale when |
| 56 // the browser window changes. | 55 // the browser window changes. |
| 57 void UpdateMaxDialogHeight(int height); | 56 void UpdateMaxDialogHeight(int height); |
| 58 | 57 |
| 59 void SetWebUIForTest(content::WebUI* webui); | 58 void SetWebUIForTest(content::WebUI* webui); |
| 60 void set_incognito_for_test(bool incognito) { incognito_ = incognito; } | 59 void set_incognito_for_test(bool incognito) { incognito_ = incognito; } |
| 61 | 60 |
| 62 private: | 61 private: |
| 63 // WebUIMessageHandler implementation. | 62 // WebUIMessageHandler implementation. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 void OnReportSelectedCastMode(const base::ListValue* args); | 82 void OnReportSelectedCastMode(const base::ListValue* args); |
| 84 void OnReportSinkCount(const base::ListValue* args); | 83 void OnReportSinkCount(const base::ListValue* args); |
| 85 void OnReportTimeToClickSink(const base::ListValue* args); | 84 void OnReportTimeToClickSink(const base::ListValue* args); |
| 86 void OnReportTimeToInitialActionClose(const base::ListValue* args); | 85 void OnReportTimeToInitialActionClose(const base::ListValue* args); |
| 87 void OnSearchSinksAndCreateRoute(const base::ListValue* args); | 86 void OnSearchSinksAndCreateRoute(const base::ListValue* args); |
| 88 void OnInitialDataReceived(const base::ListValue* args); | 87 void OnInitialDataReceived(const base::ListValue* args); |
| 89 | 88 |
| 90 // Performs an action for an Issue of |type|. | 89 // Performs an action for an Issue of |type|. |
| 91 // |args| contains additional parameter that varies based on |type|. | 90 // |args| contains additional parameter that varies based on |type|. |
| 92 // Returns |true| if the action was successfully performed. | 91 // Returns |true| if the action was successfully performed. |
| 93 bool ActOnIssueType(const IssueAction::Type& type, | 92 bool ActOnIssueType(IssueInfo::Action type, |
| 94 const base::DictionaryValue* args); | 93 const base::DictionaryValue* args); |
| 95 | 94 |
| 96 // May update the first run flow related properties in the WebUI. This is | 95 // May update the first run flow related properties in the WebUI. This is |
| 97 // called after the initial data is received to avoid unnecessary work when | 96 // called after the initial data is received to avoid unnecessary work when |
| 98 // initializing the WebUI. | 97 // initializing the WebUI. |
| 99 void MaybeUpdateFirstRunFlowData(); | 98 void MaybeUpdateFirstRunFlowData(); |
| 100 | 99 |
| 101 // Returns the current cast mode for the route with ID |route_id| or -1 if the | 100 // Returns the current cast mode for the route with ID |route_id| or -1 if the |
| 102 // route has no current cast mode. | 101 // route has no current cast mode. |
| 103 int CurrentCastModeForRouteId( | 102 int CurrentCastModeForRouteId( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 125 bool dialog_closing_; | 124 bool dialog_closing_; |
| 126 | 125 |
| 127 MediaRouterUI* media_router_ui_; | 126 MediaRouterUI* media_router_ui_; |
| 128 | 127 |
| 129 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler); | 128 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler); |
| 130 }; | 129 }; |
| 131 | 130 |
| 132 } // namespace media_router | 131 } // namespace media_router |
| 133 | 132 |
| 134 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDL
ER_H_ | 133 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDL
ER_H_ |
| OLD | NEW |