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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 content::WebContents* web_contents, | 190 content::WebContents* web_contents, |
191 const PermissionRequestID& id, | 191 const PermissionRequestID& id, |
192 const GURL& requesting_frame, | 192 const GURL& requesting_frame, |
193 bool user_gesture, | 193 bool user_gesture, |
194 const GURL& embedder, | 194 const GURL& embedder, |
195 const std::string& accept_button_label, | 195 const std::string& accept_button_label, |
196 base::Callback<void(bool)> callback) { | 196 base::Callback<void(bool)> callback) { |
197 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 197 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
198 | 198 |
199 ContentSetting content_setting = | 199 ContentSetting content_setting = |
200 profile_->GetHostContentSettingsMap()->GetContentSetting( | 200 profile_->GetHostContentSettingsMap() |
201 requesting_frame, embedder, CONTENT_SETTINGS_TYPE_GEOLOCATION, | 201 ->GetContentSettingAndMaybeUpdateLastUsage( |
202 std::string()); | 202 requesting_frame, |
| 203 embedder, |
| 204 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 205 std::string()); |
203 switch (content_setting) { | 206 switch (content_setting) { |
204 case CONTENT_SETTING_BLOCK: | 207 case CONTENT_SETTING_BLOCK: |
205 PermissionDecided(id, requesting_frame, embedder, callback, false); | 208 PermissionDecided(id, requesting_frame, embedder, callback, false); |
206 break; | 209 break; |
207 case CONTENT_SETTING_ALLOW: | 210 case CONTENT_SETTING_ALLOW: |
208 PermissionDecided(id, requesting_frame, embedder, callback, true); | 211 PermissionDecided(id, requesting_frame, embedder, callback, true); |
209 break; | 212 break; |
210 default: | 213 default: |
211 if (PermissionBubbleManager::Enabled()) { | 214 if (PermissionBubbleManager::Enabled()) { |
212 PermissionBubbleManager* mgr = | 215 PermissionBubbleManager* mgr = |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 if (cancelling != NULL && web_contents != NULL && | 323 if (cancelling != NULL && web_contents != NULL && |
321 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { | 324 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { |
322 PermissionBubbleManager::FromWebContents(web_contents)-> | 325 PermissionBubbleManager::FromWebContents(web_contents)-> |
323 CancelRequest(cancelling); | 326 CancelRequest(cancelling); |
324 } | 327 } |
325 return; | 328 return; |
326 } | 329 } |
327 | 330 |
328 QueueController()->CancelInfoBarRequest(id); | 331 QueueController()->CancelInfoBarRequest(id); |
329 } | 332 } |
OLD | NEW |