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

Unified Diff: content/browser/device_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 side-by-side diff with in-line comments
Download patch
Index: content/browser/device_orientation/message_filter.h
diff --git a/content/browser/device_orientation/orientation_message_filter.h b/content/browser/device_orientation/message_filter.h
similarity index 51%
copy from content/browser/device_orientation/orientation_message_filter.h
copy to content/browser/device_orientation/message_filter.h
index 1adf780859b1aa9ce6ce16c5f3a8f58c7f17fc90..30e669804fc6ec0a467154ea218f5c55edde7579 100644
--- a/content/browser/device_orientation/orientation_message_filter.h
+++ b/content/browser/device_orientation/message_filter.h
@@ -2,41 +2,43 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_
-#define CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_
+#ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_MESSAGE_FILTER_H_
+#define CONTENT_BROWSER_DEVICE_ORIENTATION_MESSAGE_FILTER_H_
#include <map>
-#include "content/browser/device_orientation/provider.h"
+#include "content/browser/device_orientation/device_data.h"
#include "content/public/browser/browser_message_filter.h"
namespace device_orientation {
-class OrientationMessageFilter : public content::BrowserMessageFilter {
- public:
- OrientationMessageFilter();
+// Helper class that observes a Provider and forwards updates to a RenderView.
+class ObserverDelegate;
+
+class Provider;
+class MessageFilter : public content::BrowserMessageFilter {
+ public:
// content::BrowserMessageFilter implementation.
virtual bool OnMessageReceived(const IPC::Message& message,
- bool* message_was_ok) OVERRIDE;
+ bool* message_was_ok) OVERRIDE = 0;
- private:
- virtual ~OrientationMessageFilter();
+ protected:
+ MessageFilter(DeviceData::Type device_data_type);
+ virtual ~MessageFilter();
void OnStartUpdating(int render_view_id);
void OnStopUpdating(int render_view_id);
- // Helper class that observes a Provider and forwards updates to a RenderView.
- class ObserverDelegate;
+ private:
// map from render_view_id to ObserverDelegate.
std::map<int, scoped_refptr<ObserverDelegate> > observers_map_;
scoped_refptr<Provider> provider_;
-
- DISALLOW_COPY_AND_ASSIGN(OrientationMessageFilter);
+ DeviceData::Type device_data_type_;
};
} // namespace device_orientation
-#endif // CONTENT_BROWSER_DEVICE_ORIENTATION_ORIENTATION_MESSAGE_FILTER_H_
+#endif // CONTENT_BROWSER_DEVICE_ORIENTATION_MESSAGE_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698