OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ | 6 #define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
7 | 7 |
8 // The flow for geolocation permissions on Android needs to take into account | 8 // The flow for geolocation permissions on Android needs to take into account |
9 // the global geolocation settings so it differs from the desktop one. It | 9 // the global geolocation settings so it differs from the desktop one. It |
10 // works as follows. | 10 // works as follows. |
11 // GeolocationPermissionContextAndroid::RequestPermission intercepts the flow | 11 // GeolocationPermissionContextAndroid::RequestPermission intercepts the flow |
12 // and proceeds to check the system location. | 12 // and proceeds to check the system location. |
13 // This will in fact check several possible settings | 13 // This will in fact check several possible settings |
14 // - The global system geolocation setting | 14 // - The global system geolocation setting |
15 // - The Google location settings on pre KK devices | 15 // - The Google location settings on pre KK devices |
16 // - An old internal Chrome setting on pre-JB MR1 devices | 16 // - An old internal Chrome setting on pre-JB MR1 devices |
17 // With all that information it will decide if system location is enabled. | 17 // With all that information it will decide if system location is enabled. |
18 // If enabled, it proceeds with the per site flow via | 18 // If enabled, it proceeds with the per site flow via |
19 // GeolocationPermissionContext (which will check per site permissions, create | 19 // GeolocationPermissionContext (which will check per site permissions, create |
20 // infobars, etc.). | 20 // infobars, etc.). |
21 // | 21 // |
22 // Otherwise the permission is already decided. | 22 // Otherwise the permission is already decided. |
| 23 #include "base/macros.h" |
23 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
24 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
25 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 26 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
26 | 27 |
27 namespace content { | 28 namespace content { |
28 class WebContents; | 29 class WebContents; |
29 } | 30 } |
30 | 31 |
31 class LocationSettings; | 32 class LocationSettings; |
32 class GURL; | 33 class GURL; |
(...skipping 29 matching lines...) Expand all Loading... |
62 scoped_ptr<LocationSettings> location_settings_; | 63 scoped_ptr<LocationSettings> location_settings_; |
63 | 64 |
64 // Must be the last member, to ensure that it will be destroyed first, which | 65 // Must be the last member, to ensure that it will be destroyed first, which |
65 // will invalidate weak pointers. | 66 // will invalidate weak pointers. |
66 base::WeakPtrFactory<GeolocationPermissionContextAndroid> weak_factory_; | 67 base::WeakPtrFactory<GeolocationPermissionContextAndroid> weak_factory_; |
67 | 68 |
68 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextAndroid); | 69 DISALLOW_COPY_AND_ASSIGN(GeolocationPermissionContextAndroid); |
69 }; | 70 }; |
70 | 71 |
71 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ | 72 #endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_ANDROID_H_ |
OLD | NEW |