Chromium Code Reviews| 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 #include "chrome/browser/geolocation/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/content_settings/core/common/permission_request_id.h" | 10 #include "components/content_settings/core/common/permission_request_id.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 if (extensions_context_.RequestPermission( | 35 if (extensions_context_.RequestPermission( |
| 36 web_contents, id, id.bridge_id(), requesting_frame_origin, user_gesture, | 36 web_contents, id, id.bridge_id(), requesting_frame_origin, user_gesture, |
| 37 callback, &permission_set, &new_permission)) { | 37 callback, &permission_set, &new_permission)) { |
| 38 if (permission_set) { | 38 if (permission_set) { |
| 39 ContentSetting content_setting = | 39 ContentSetting content_setting = |
| 40 new_permission ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 40 new_permission ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
| 41 NotifyPermissionSet(id, | 41 NotifyPermissionSet(id, |
| 42 requesting_frame_origin, | 42 requesting_frame_origin, |
| 43 web_contents->GetLastCommittedURL().GetOrigin(), | 43 web_contents->GetLastCommittedURL().GetOrigin(), |
| 44 callback, | 44 callback, |
| 45 true, | 45 false, |
|
Michael van Ouwerkerk
2015/06/04 12:50:38
nit: add /* persist */ for readability.
Bernhard Bauer
2015/06/04 13:22:36
Done.
| |
| 46 content_setting); | 46 content_setting); |
| 47 } | 47 } |
| 48 return; | 48 return; |
| 49 } | 49 } |
| 50 | 50 |
| 51 PermissionContextBase::RequestPermission(web_contents, id, | 51 PermissionContextBase::RequestPermission(web_contents, id, |
| 52 requesting_frame_origin, | 52 requesting_frame_origin, |
| 53 user_gesture, | 53 user_gesture, |
| 54 callback); | 54 callback); |
| 55 } | 55 } |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 78 | 78 |
| 79 if (allowed) { | 79 if (allowed) { |
| 80 content::GeolocationProvider::GetInstance() | 80 content::GeolocationProvider::GetInstance() |
| 81 ->UserDidOptIntoLocationServices(); | 81 ->UserDidOptIntoLocationServices(); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const { | 85 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const { |
| 86 return false; | 86 return false; |
| 87 } | 87 } |
| OLD | NEW |