| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // |route|: nullptr | 27 // |route|: nullptr |
| 28 // |presentation_id|: Empty string. | 28 // |presentation_id|: Empty string. |
| 29 // |error|: Non-empty string describing the error. | 29 // |error|: Non-empty string describing the error. |
| 30 // |result_code|: A value from RouteRequestResult describing the error. | 30 // |result_code|: A value from RouteRequestResult describing the error. |
| 31 class RouteRequestResult { | 31 class RouteRequestResult { |
| 32 public: | 32 public: |
| 33 // Keep in sync with: | 33 // Keep in sync with: |
| 34 // - RouteRequestResultCode in media_router.mojom | 34 // - RouteRequestResultCode in media_router.mojom |
| 35 // - MediaRouteProviderResult enum in tools/metrics/histograms.xml | 35 // - MediaRouteProviderResult enum in tools/metrics/histograms.xml |
| 36 // - mr.RouteRequestResultCode in route_request_error.js | 36 // - mr.RouteRequestResultCode in route_request_error.js |
| 37 // - RouteRequestResultCodeFromMojo in media_router_type_converters.cc |
| 37 enum ResultCode { | 38 enum ResultCode { |
| 38 UNKNOWN_ERROR = 0, | 39 UNKNOWN_ERROR = 0, |
| 39 OK = 1, | 40 OK = 1, |
| 40 TIMED_OUT = 2, | 41 TIMED_OUT = 2, |
| 41 ROUTE_NOT_FOUND = 3, | 42 ROUTE_NOT_FOUND = 3, |
| 42 SINK_NOT_FOUND = 4, | 43 SINK_NOT_FOUND = 4, |
| 43 INVALID_ORIGIN = 5, | 44 INVALID_ORIGIN = 5, |
| 44 INCOGNITO_MISMATCH = 6, | 45 INCOGNITO_MISMATCH = 6, |
| 45 NO_SUPPORTED_PROVIDER = 7, | 46 NO_SUPPORTED_PROVIDER = 7, |
| 47 CANCELLED = 8, |
| 46 // New values must be added here. | 48 // New values must be added here. |
| 47 | 49 |
| 48 TOTAL_COUNT = 8 // The total number of values. | 50 TOTAL_COUNT = 9 // The total number of values. |
| 49 }; | 51 }; |
| 50 | 52 |
| 51 static std::unique_ptr<RouteRequestResult> FromSuccess( | 53 static std::unique_ptr<RouteRequestResult> FromSuccess( |
| 52 std::unique_ptr<MediaRoute> route, | 54 std::unique_ptr<MediaRoute> route, |
| 53 const std::string& presentation_id); | 55 const std::string& presentation_id); |
| 54 static std::unique_ptr<RouteRequestResult> FromError(const std::string& error, | 56 static std::unique_ptr<RouteRequestResult> FromError(const std::string& error, |
| 55 ResultCode result_code); | 57 ResultCode result_code); |
| 56 | 58 |
| 57 ~RouteRequestResult(); | 59 ~RouteRequestResult(); |
| 58 | 60 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 73 std::string presentation_id_; | 75 std::string presentation_id_; |
| 74 std::string error_; | 76 std::string error_; |
| 75 ResultCode result_code_; | 77 ResultCode result_code_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(RouteRequestResult); | 79 DISALLOW_COPY_AND_ASSIGN(RouteRequestResult); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace media_router | 82 } // namespace media_router |
| 81 | 83 |
| 82 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ | 84 #endif // CHROME_BROWSER_MEDIA_ROUTER_ROUTE_REQUEST_RESULT_H_ |
| OLD | NEW |