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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 content::WebContents* web_contents, | 202 content::WebContents* web_contents, |
203 const PermissionRequestID& id, | 203 const PermissionRequestID& id, |
204 const GURL& requesting_frame, | 204 const GURL& requesting_frame, |
205 bool user_gesture, | 205 bool user_gesture, |
206 const GURL& embedder, | 206 const GURL& embedder, |
207 const std::string& accept_button_label, | 207 const std::string& accept_button_label, |
208 base::Callback<void(bool)> callback) { | 208 base::Callback<void(bool)> callback) { |
209 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 209 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
210 | 210 |
211 ContentSetting content_setting = | 211 ContentSetting content_setting = |
212 profile_->GetHostContentSettingsMap()->GetContentSetting( | 212 profile_->GetHostContentSettingsMap() |
213 requesting_frame, embedder, CONTENT_SETTINGS_TYPE_GEOLOCATION, | 213 ->GetContentSettingAndMaybeUpdateLastUsage( |
214 std::string()); | 214 requesting_frame, |
| 215 embedder, |
| 216 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 217 std::string()); |
215 switch (content_setting) { | 218 switch (content_setting) { |
216 case CONTENT_SETTING_BLOCK: | 219 case CONTENT_SETTING_BLOCK: |
217 PermissionDecided(id, requesting_frame, embedder, callback, false); | 220 PermissionDecided(id, requesting_frame, embedder, callback, false); |
218 break; | 221 break; |
219 case CONTENT_SETTING_ALLOW: | 222 case CONTENT_SETTING_ALLOW: |
220 PermissionDecided(id, requesting_frame, embedder, callback, true); | 223 PermissionDecided(id, requesting_frame, embedder, callback, true); |
221 break; | 224 break; |
222 default: | 225 default: |
223 if (PermissionBubbleManager::Enabled()) { | 226 if (PermissionBubbleManager::Enabled()) { |
224 PermissionBubbleManager* mgr = | 227 PermissionBubbleManager* mgr = |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 if (cancelling != NULL && web_contents != NULL && | 335 if (cancelling != NULL && web_contents != NULL && |
333 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { | 336 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { |
334 PermissionBubbleManager::FromWebContents(web_contents)-> | 337 PermissionBubbleManager::FromWebContents(web_contents)-> |
335 CancelRequest(cancelling); | 338 CancelRequest(cancelling); |
336 } | 339 } |
337 return; | 340 return; |
338 } | 341 } |
339 | 342 |
340 QueueController()->CancelInfoBarRequest(id); | 343 QueueController()->CancelInfoBarRequest(id); |
341 } | 344 } |
OLD | NEW |