| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Does not take ownership of |issue|. Note that |issue| can be nullptr, when | 51 // Does not take ownership of |issue|. Note that |issue| can be nullptr, when |
| 52 // there are no more issues. | 52 // there are no more issues. |
| 53 void UpdateIssue(const Issue* issue); | 53 void UpdateIssue(const Issue* issue); |
| 54 | 54 |
| 55 // Updates the maximum dialog height to allow the WebUI properly scale when | 55 // Updates the maximum dialog height to allow the WebUI properly scale when |
| 56 // the browser window changes. | 56 // the browser window changes. |
| 57 void UpdateMaxDialogHeight(int height); | 57 void UpdateMaxDialogHeight(int height); |
| 58 | 58 |
| 59 void SetWebUIForTest(content::WebUI* webui); | 59 void SetWebUIForTest(content::WebUI* webui); |
| 60 void set_off_the_record_for_test(bool off_the_record) { | 60 void set_incognito_for_test(bool incognito) { incognito_ = incognito; } |
| 61 off_the_record_ = off_the_record; | |
| 62 } | |
| 63 | 61 |
| 64 private: | 62 private: |
| 65 // WebUIMessageHandler implementation. | 63 // WebUIMessageHandler implementation. |
| 66 void RegisterMessages() override; | 64 void RegisterMessages() override; |
| 67 | 65 |
| 68 // Handlers for JavaScript messages. | 66 // Handlers for JavaScript messages. |
| 69 // See media_router_ui_interface.js for documentation on parameters. | 67 // See media_router_ui_interface.js for documentation on parameters. |
| 70 void OnRequestInitialData(const base::ListValue* args); | 68 void OnRequestInitialData(const base::ListValue* args); |
| 71 void OnCreateRoute(const base::ListValue* args); | 69 void OnCreateRoute(const base::ListValue* args); |
| 72 void OnAcknowledgeFirstRunFlow(const base::ListValue* args); | 70 void OnAcknowledgeFirstRunFlow(const base::ListValue* args); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 const std::vector<MediaRoute>& routes, | 111 const std::vector<MediaRoute>& routes, |
| 114 const std::vector<MediaRoute::Id>& joinable_route_ids, | 112 const std::vector<MediaRoute::Id>& joinable_route_ids, |
| 115 const std::unordered_map<MediaRoute::Id, MediaCastMode>& | 113 const std::unordered_map<MediaRoute::Id, MediaCastMode>& |
| 116 current_cast_modes) const; | 114 current_cast_modes) const; |
| 117 | 115 |
| 118 // Retrieve the account info for email and domain of signed in users. This is | 116 // Retrieve the account info for email and domain of signed in users. This is |
| 119 // used when updating sinks to determine if identity should be displayed. | 117 // used when updating sinks to determine if identity should be displayed. |
| 120 // Marked virtual for tests. | 118 // Marked virtual for tests. |
| 121 virtual AccountInfo GetAccountInfo(); | 119 virtual AccountInfo GetAccountInfo(); |
| 122 | 120 |
| 123 // |true| if the associated Profile is off the record. | 121 // |true| if the associated Profile is incognito. |
| 124 bool off_the_record_; | 122 bool incognito_; |
| 125 | 123 |
| 126 // Keeps track of whether a command to close the dialog has been issued. | 124 // Keeps track of whether a command to close the dialog has been issued. |
| 127 bool dialog_closing_; | 125 bool dialog_closing_; |
| 128 | 126 |
| 129 MediaRouterUI* media_router_ui_; | 127 MediaRouterUI* media_router_ui_; |
| 130 | 128 |
| 131 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler); | 129 DISALLOW_COPY_AND_ASSIGN(MediaRouterWebUIMessageHandler); |
| 132 }; | 130 }; |
| 133 | 131 |
| 134 } // namespace media_router | 132 } // namespace media_router |
| 135 | 133 |
| 136 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDL
ER_H_ | 134 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_WEBUI_MESSAGE_HANDL
ER_H_ |
| OLD | NEW |