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 18 matching lines...) Expand all Loading... | |
| 29 bool user_gesture, | 29 bool user_gesture, |
| 30 const BrowserPermissionCallback& callback) { | 30 const BrowserPermissionCallback& callback) { |
| 31 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 31 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 32 | 32 |
| 33 bool permission_set; | 33 bool permission_set; |
| 34 bool new_permission; | 34 bool new_permission; |
| 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 NotifyPermissionSet(id, | 39 NotifyPermissionSet( |
| 40 requesting_frame_origin, | 40 id, requesting_frame_origin, |
| 41 web_contents->GetLastCommittedURL().GetOrigin(), | 41 web_contents->GetLastCommittedURL().GetOrigin(), callback, true, |
| 42 callback, | 42 new_permission ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); |
|
Michael van Ouwerkerk
2015/02/26 15:09:49
nit: the call to NotifyPermissionSet would be a bi
mlamouri (slow - plz ping)
2015/02/26 21:19:38
Done.
| |
| 43 true, | |
| 44 new_permission); | |
| 45 } | 43 } |
| 46 return; | 44 return; |
| 47 } | 45 } |
| 48 | 46 |
| 49 PermissionContextBase::RequestPermission(web_contents, id, | 47 PermissionContextBase::RequestPermission(web_contents, id, |
| 50 requesting_frame_origin, | 48 requesting_frame_origin, |
| 51 user_gesture, | 49 user_gesture, |
| 52 callback); | 50 callback); |
| 53 } | 51 } |
| 54 | 52 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 72 id.render_view_id()); | 70 id.render_view_id()); |
| 73 if (content_settings) | 71 if (content_settings) |
| 74 content_settings->OnGeolocationPermissionSet( | 72 content_settings->OnGeolocationPermissionSet( |
| 75 requesting_frame.GetOrigin(), allowed); | 73 requesting_frame.GetOrigin(), allowed); |
| 76 | 74 |
| 77 if (allowed) { | 75 if (allowed) { |
| 78 content::GeolocationProvider::GetInstance() | 76 content::GeolocationProvider::GetInstance() |
| 79 ->UserDidOptIntoLocationServices(); | 77 ->UserDidOptIntoLocationServices(); |
| 80 } | 78 } |
| 81 } | 79 } |
| OLD | NEW |