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

Side by Side Diff: content/renderer/wake_lock/wake_lock_dispatcher.h

Issue 486383003: WakeLock API: IPC at renderer side. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 2014 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 CONTENT_RENDERER_WAKE_LOCK_WAKE_LOCK_DISPATCHER_H_
6 #define CONTENT_RENDERER_WAKE_LOCK_WAKE_LOCK_DISPATCHER_H_
7
8 #include "content/public/renderer/render_view_observer.h"
9 #include "third_party/WebKit/public/platform/WebWakeLockClient.h"
10
11 namespace content {
12
13 // WakeLockDispatcher is a delegate for WakeLock messages used by WebKit.
14 // It's the complement of WakeLockDispatcherHost.
15 class CONTENT_EXPORT WakeLockDispatcher
16 : public RenderViewObserver,
17 NON_EXPORTED_BASE(public blink::WebWakeLockClient) {
18 public:
19 explicit WakeLockDispatcher(RenderView* render_view);
20 virtual ~WakeLockDispatcher();
21
22 private:
23 friend class WakeLockDispatcherTest;
24
25 blink::WebWakeLockRequestCallback* callback_;
26
27 // RenderFrame::Observer implementation.
28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
29
30 // WebWakeLockClient
31 virtual void requestWakeLock(const blink::WakeLockRequestInfo&,
32 const blink::WebSecurityOrigin&) OVERRIDE;
33 virtual void requestWakeUnlock(const blink::WakeLockRequestInfo&) OVERRIDE;
34 virtual void wakeLockDestroyed() OVERRIDE;
35 virtual void setRequestCallback(blink::WebWakeLockRequestCallback*) OVERRIDE;
36
37 void OnCreatedWakeLockSuccessful(int request_id);
38 void OnCreatedWakeLockFailed(int request_id);
39 void OnUnlockedWakeLockSuccessful(int request_id);
40 void OnUnlockedWakeLockFailed(int request_id);
41 };
42 } // namespace content
43
44 #endif // CONTENT_RENDERER_WAKE_LOCK_WAKE_LOCK_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698