OLD | NEW |
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 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_andro
id.h" | 5 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_andro
id.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/android/google_location_settings_helper.h" | 8 #include "chrome/browser/android/google_location_settings_helper.h" |
9 #include "chrome/browser/content_settings/permission_request_id.h" | 9 #include "chrome/browser/content_settings/permission_request_id.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // This method is executed from the BlockingPool, post the result | 79 // This method is executed from the BlockingPool, post the result |
80 // back to the UI thread. | 80 // back to the UI thread. |
81 content::BrowserThread::PostTask( | 81 content::BrowserThread::PostTask( |
82 content::BrowserThread::UI, FROM_HERE, ui_closure); | 82 content::BrowserThread::UI, FROM_HERE, ui_closure); |
83 } | 83 } |
84 | 84 |
85 void ChromeGeolocationPermissionContextAndroid::DecidePermission( | 85 void ChromeGeolocationPermissionContextAndroid::DecidePermission( |
86 content::WebContents* web_contents, | 86 content::WebContents* web_contents, |
87 const PermissionRequestID& id, | 87 const PermissionRequestID& id, |
88 const GURL& requesting_frame, | 88 const GURL& requesting_frame, |
| 89 bool user_gesture, |
89 const GURL& embedder, | 90 const GURL& embedder, |
90 const std::string& accept_button_label, | 91 const std::string& accept_button_label, |
91 base::Callback<void(bool)> callback) { | 92 base::Callback<void(bool)> callback) { |
92 | 93 |
93 // Called on the UI thread. However, do the work on a separate thread | 94 // Called on the UI thread. However, do the work on a separate thread |
94 // to avoid strict mode violation. | 95 // to avoid strict mode violation. |
95 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 96 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
96 content::BrowserThread::PostBlockingPoolTask(FROM_HERE, | 97 content::BrowserThread::PostBlockingPoolTask(FROM_HERE, |
97 base::Bind( | 98 base::Bind( |
98 &ChromeGeolocationPermissionContextAndroid::CheckMasterLocation, | 99 &ChromeGeolocationPermissionContextAndroid::CheckMasterLocation, |
(...skipping 12 matching lines...) Expand all Loading... |
111 if (allowed && | 112 if (allowed && |
112 !google_location_settings_helper_->IsGoogleAppsLocationSettingEnabled()) { | 113 !google_location_settings_helper_->IsGoogleAppsLocationSettingEnabled()) { |
113 QueueController()->CreateInfoBarRequest(id, requesting_frame, embedder, "", | 114 QueueController()->CreateInfoBarRequest(id, requesting_frame, embedder, "", |
114 callback); | 115 callback); |
115 return; | 116 return; |
116 } | 117 } |
117 | 118 |
118 ChromeGeolocationPermissionContext::PermissionDecided( | 119 ChromeGeolocationPermissionContext::PermissionDecided( |
119 id, requesting_frame, embedder, callback, allowed); | 120 id, requesting_frame, embedder, callback, allowed); |
120 } | 121 } |
OLD | NEW |