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

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

Issue 10755002: Refactors DeviceOrientation to make it more extensible (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Handles null device_data in observer Created 8 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
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_DATA_FETCHER_H_ 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_H_
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_H_ 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_H_
7 7
8 #include "content/browser/device_orientation/device_data.h"
9
8 namespace device_orientation { 10 namespace device_orientation {
9 11
10 class Orientation;
11
12 class DataFetcher { 12 class DataFetcher {
13 public: 13 public:
14 virtual ~DataFetcher() {} 14 virtual ~DataFetcher() {}
15 15
16 // Returns false if there was a fatal error getting the orientation. 16 // Returns NULL if there was a fatal error getting the device data of this
17 // Returns true otherwise. If the fetcher has orientation data available 17 // type or if this fetcher can never provide this type of data. Otherwise,
18 // it will fill it in, otherwise the argument will be unaltered. 18 // returns a pointer to a DeviceData containing the most recent data.
19 virtual bool GetOrientation(Orientation*) = 0; 19 virtual DeviceData* GetDeviceData(DeviceData::Type device_data_type) = 0;
aousterh 2012/07/20 11:18:52 I changed this to const DeviceData*, since it shou
20 }; 20 };
21 21
22 } // namespace device_orientation 22 } // namespace device_orientation
23 23
24 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_H_ 24 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_DATA_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698