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

Side by Side Diff: content/browser/device_orientation/orientation_message_filter.h

Issue 10755002: Refactors DeviceOrientation to make it more extensible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small changes to appease try bots Created 8 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_ 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "content/browser/device_orientation/provider.h" 10 #include "content/browser/device_orientation/message_filter.h"
11 #include "content/public/browser/browser_message_filter.h"
12 11
13 namespace device_orientation { 12 namespace device_orientation {
14 13
15 class OrientationMessageFilter : public content::BrowserMessageFilter { 14 class OrientationMessageFilter : public MessageFilter {
16 public: 15 public:
17 OrientationMessageFilter(); 16 OrientationMessageFilter();
18 17
19 // content::BrowserMessageFilter implementation. 18 // content::BrowserMessageFilter implementation.
20 virtual bool OnMessageReceived(const IPC::Message& message, 19 virtual bool OnMessageReceived(const IPC::Message& message,
21 bool* message_was_ok) OVERRIDE; 20 bool* message_was_ok) OVERRIDE;
22 21
23 private: 22 private:
24 virtual ~OrientationMessageFilter(); 23 virtual ~OrientationMessageFilter();
25 24
26 void OnStartUpdating(int render_view_id);
27 void OnStopUpdating(int render_view_id);
28
29 // Helper class that observes a Provider and forwards updates to a RenderView.
30 class ObserverDelegate;
31
32 // map from render_view_id to ObserverDelegate.
33 std::map<int, scoped_refptr<ObserverDelegate> > observers_map_;
34
35 scoped_refptr<Provider> provider_;
36
37 DISALLOW_COPY_AND_ASSIGN(OrientationMessageFilter); 25 DISALLOW_COPY_AND_ASSIGN(OrientationMessageFilter);
38 }; 26 };
39 27
40 } // namespace device_orientation 28 } // namespace device_orientation
41 29
42 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_ 30 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « content/browser/device_orientation/orientation.cc ('k') | content/browser/device_orientation/orientation_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698