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/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 content::WebContents* web_contents, | 194 content::WebContents* web_contents, |
195 const PermissionRequestID& id, | 195 const PermissionRequestID& id, |
196 const GURL& requesting_frame, | 196 const GURL& requesting_frame, |
197 bool user_gesture, | 197 bool user_gesture, |
198 const GURL& embedder, | 198 const GURL& embedder, |
199 const std::string& accept_button_label, | 199 const std::string& accept_button_label, |
200 base::Callback<void(bool)> callback) { | 200 base::Callback<void(bool)> callback) { |
201 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 201 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
202 | 202 |
203 ContentSetting content_setting = | 203 ContentSetting content_setting = |
204 profile_->GetHostContentSettingsMap()->GetContentSetting( | 204 profile_->GetHostContentSettingsMap() |
205 requesting_frame, embedder, CONTENT_SETTINGS_TYPE_GEOLOCATION, | 205 ->GetContentSettingAndMaybeUpdateLastUsage( |
Michael van Ouwerkerk
2014/07/01 11:02:23
This doesn't make sense to me. If permission has a
Daniel Nishi
2014/07/01 18:37:48
This location only tracks if permission is asked f
Michael van Ouwerkerk
2014/07/02 18:51:15
Cool, thanks.
| |
206 std::string()); | 206 requesting_frame, |
207 embedder, | |
208 CONTENT_SETTINGS_TYPE_GEOLOCATION, | |
209 std::string()); | |
207 switch (content_setting) { | 210 switch (content_setting) { |
208 case CONTENT_SETTING_BLOCK: | 211 case CONTENT_SETTING_BLOCK: |
209 PermissionDecided(id, requesting_frame, embedder, callback, false); | 212 PermissionDecided(id, requesting_frame, embedder, callback, false); |
210 break; | 213 break; |
211 case CONTENT_SETTING_ALLOW: | 214 case CONTENT_SETTING_ALLOW: |
212 PermissionDecided(id, requesting_frame, embedder, callback, true); | 215 PermissionDecided(id, requesting_frame, embedder, callback, true); |
213 break; | 216 break; |
214 default: | 217 default: |
215 if (PermissionBubbleManager::Enabled()) { | 218 if (PermissionBubbleManager::Enabled()) { |
216 PermissionBubbleManager* mgr = | 219 PermissionBubbleManager* mgr = |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
324 if (cancelling != NULL && web_contents != NULL && | 327 if (cancelling != NULL && web_contents != NULL && |
325 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { | 328 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { |
326 PermissionBubbleManager::FromWebContents(web_contents)-> | 329 PermissionBubbleManager::FromWebContents(web_contents)-> |
327 CancelRequest(cancelling); | 330 CancelRequest(cancelling); |
328 } | 331 } |
329 return; | 332 return; |
330 } | 333 } |
331 | 334 |
332 QueueController()->CancelInfoBarRequest(id); | 335 QueueController()->CancelInfoBarRequest(id); |
333 } | 336 } |
OLD | NEW |