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

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

Issue 406483004: Initial implementation of API WakeLock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (c) 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_DISPATCHER_H_
6 #define CONTENT_RENDERER_WAKE_LOCK_DISPATCHER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/public/renderer/render_view_observer.h"
10 #include "third_party/WebKit/public/web/WebView.h"
11 #include "third_party/WebKit/public/web/WebWakeLockClient.h"
12 #include "third_party/WebKit/public/web/WebWakeLockController.h"
13
14 namespace content {
15
16 // WakeLockDispatcher is a delegate for WakeLock messages used by WebKit.
17 // It's the complement of WakeLockDispatcherHost (owned by RenderViewHost).
18 class WakeLockDispatcher : public content::RenderViewObserver,
19 public blink::WebWakeLockClient {
20 public:
21 explicit WakeLockDispatcher(content::RenderView* render_view);
22 virtual ~WakeLockDispatcher();
23
24 private:
25 int routing_id_;
26 scoped_ptr<blink::WebWakeLockController> controller_;
27
28 // RenderView::Observer implementation.
29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
30
31 // WebWakeLockClient
32 virtual void requestWakeLock();
33 virtual void requestWakeUnlock();
34 virtual void wakeLockDestroyed();
35 virtual void setController(blink::WebWakeLockController*);
36
37 void OnWakeLockCreatedSuccessful();
38 void OnWakeLockCreatedFailed();
39 void OnWakeLockUnlockedSuccessful();
40 void OnWakeLockUnlockedFailed();
41 };
42 }
43
44 #endif // CONTENT_RENDERER_WAKE_LOCK_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698