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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationError.cpp

Issue 2533073002: [Presentation API] Throw NotAllowedError instead of AbortError when user closes MR dialog (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « chrome/test/media_router/media_router_integration_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "modules/presentation/PresentationError.h" 5 #include "modules/presentation/PresentationError.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "public/platform/modules/presentation/WebPresentationError.h" 9 #include "public/platform/modules/presentation/WebPresentationError.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // static 13 // static
14 DOMException* PresentationError::take(ScriptPromiseResolver*, 14 DOMException* PresentationError::take(ScriptPromiseResolver*,
15 const WebPresentationError& error) { 15 const WebPresentationError& error) {
16 ExceptionCode code = UnknownError; 16 ExceptionCode code = UnknownError;
17 switch (error.errorType) { 17 switch (error.errorType) {
18 case WebPresentationError::ErrorTypeNoAvailableScreens: 18 case WebPresentationError::ErrorTypeNoAvailableScreens:
19 case WebPresentationError::ErrorTypeNoPresentationFound: 19 case WebPresentationError::ErrorTypeNoPresentationFound:
20 code = NotFoundError; 20 code = NotFoundError;
21 break; 21 break;
22 case WebPresentationError::ErrorTypeSessionRequestCancelled: 22 case WebPresentationError::ErrorTypeSessionRequestCancelled:
23 code = AbortError; 23 code = NotAllowedError;
24 break; 24 break;
25 case WebPresentationError::ErrorTypeAvailabilityNotSupported: 25 case WebPresentationError::ErrorTypeAvailabilityNotSupported:
26 code = NotSupportedError; 26 code = NotSupportedError;
27 break; 27 break;
28 case WebPresentationError::ErrorTypeUnknown: 28 case WebPresentationError::ErrorTypeUnknown:
29 code = UnknownError; 29 code = UnknownError;
30 break; 30 break;
31 } 31 }
32 32
33 return DOMException::create(code, error.message); 33 return DOMException::create(code, error.message);
34 } 34 }
35 35
36 } // namespace blink 36 } // namespace blink
OLDNEW
« no previous file with comments | « chrome/test/media_router/media_router_integration_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698