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

Side by Side Diff: chrome/browser/geolocation/core_location_data_provider_mac.h

Issue 3092015: Add CoreLocation support to Chrome (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Final rearrangements and merge with trunk Created 10 years, 3 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
« no previous file with comments | « AUTHORS ('k') | chrome/browser/geolocation/core_location_data_provider_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 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 // This file declares a CoreLocation data provider class that allows the
6 // CoreLocation framework to run on the UI thread, since the Geolocation API's
7 // providers all live on the IO thread
8
9 #ifndef CHROME_BROWSER_GEOLOCATION_CORE_LOCATION_DATA_PROVIDER_H_
10 #define CHROME_BROWSER_GEOLOCATION_CORE_LOCATION_DATA_PROVIDER_H_
11 #pragma once
12
13 #include "base/ref_counted.h"
14 #include "base/scoped_nsobject.h"
15 #include "chrome/browser/chrome_thread.h"
16 #include "chrome/common/geoposition.h"
17
18 #import <Foundation/Foundation.h>
19
20 class CoreLocationProviderMac;
21 @class CoreLocationWrapperMac;
22
23 // Data provider class that allows CoreLocation to run in Chrome's UI thread
24 // while existing on any of Chrome's threads (in this case the IO thread)
25 class CoreLocationDataProviderMac
26 : public base::RefCountedThreadSafe<CoreLocationDataProviderMac> {
27 public:
28 CoreLocationDataProviderMac();
29
30 bool StartUpdating(CoreLocationProviderMac* provider);
31 void StopUpdating();
32
33 void UpdatePosition(Geoposition *position);
34
35 protected:
36 friend class base::RefCountedThreadSafe<CoreLocationDataProviderMac>;
37 ~CoreLocationDataProviderMac();
38
39 private:
40 // These must execute in ChromeThread::UI
41 void StartUpdatingTask();
42 void StopUpdatingTask();
43 // This must execute in the origin thread (IO thread)
44 void PositionUpdated(Geoposition position);
45
46 // The wrapper class that supplies this class with position data
47 scoped_nsobject<CoreLocationWrapperMac> wrapper_;
48 // The LocationProviderBase class that should receive position data
49 CoreLocationProviderMac* provider_;
50 ChromeThread::ID origin_thread_id_;
51 };
52
53 #endif
OLDNEW
« no previous file with comments | « AUTHORS ('k') | chrome/browser/geolocation/core_location_data_provider_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698