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

Side by Side Diff: Source/modules/presentation/PresentationAvailabilityCallback.h

Issue 1222623003: Presentation API: implement .getAvalability() (Blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix tests Created 5 years, 5 months 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef PresentationAvailabilityCallback_h
6 #define PresentationAvailabilityCallback_h
7
8 #include "platform/heap/Handle.h"
9 #include "public/platform/WebCallbacks.h"
10 #include "wtf/Noncopyable.h"
11
12 namespace blink {
13
14 class ScriptPromiseResolver;
15
16 using WebPresentationAvailabilityCallbacks = WebCallbacks<bool, void>;
17
18 // PresentationAvailabilityCallback is an implementation of
19 // WebPresentationAvailabilityCallbacks that will resolve the underlying promise
20 // depending on the result passed to the callback.
21 class PresentationAvailabilityCallback final
22 : public WebPresentationAvailabilityCallbacks {
23 WTF_MAKE_NONCOPYABLE(PresentationAvailabilityCallback);
24 public:
25 explicit PresentationAvailabilityCallback(PassRefPtrWillBeRawPtr<ScriptPromi seResolver>);
26 virtual ~PresentationAvailabilityCallback() = default;
27
28 void onSuccess(bool*) override;
29 void onError() override;
30
31 private:
32 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver;
33 };
34
35 } // namespace blink
36
37 #endif // PresentationAvailabilityCallback_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698