Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/browser/geolocation/geolocation_permission_context.cc

Issue 2627853002: Show the search geolocation disclosure from geolocation API use. (Closed)
Patch Set: Fix ChromeOS Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/permissions/permission_request_id.h" 9 #include "chrome/browser/permissions/permission_request_id.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 23 matching lines...) Expand all
34 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 34 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
35 35
36 bool permission_set; 36 bool permission_set;
37 bool new_permission; 37 bool new_permission;
38 if (extensions_context_.DecidePermission( 38 if (extensions_context_.DecidePermission(
39 web_contents, id, id.request_id(), requesting_origin, user_gesture, 39 web_contents, id, id.request_id(), requesting_origin, user_gesture,
40 callback, &permission_set, &new_permission)) { 40 callback, &permission_set, &new_permission)) {
41 if (permission_set) { 41 if (permission_set) {
42 ContentSetting content_setting = 42 ContentSetting content_setting =
43 new_permission ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; 43 new_permission ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK;
44 NotifyPermissionSet(id, 44 NotifyPermissionSet(web_contents, id, requesting_origin,
45 requesting_origin,
46 web_contents->GetLastCommittedURL().GetOrigin(), 45 web_contents->GetLastCommittedURL().GetOrigin(),
47 callback, 46 callback, false /* persist */, content_setting);
48 false /* persist */,
49 content_setting);
50 } 47 }
51 return; 48 return;
52 } 49 }
53 50
54 PermissionContextBase::DecidePermission(web_contents, 51 PermissionContextBase::DecidePermission(web_contents,
55 id, 52 id,
56 requesting_origin, 53 requesting_origin,
57 embedding_origin, 54 embedding_origin,
58 user_gesture, 55 user_gesture,
59 callback); 56 callback);
(...skipping 25 matching lines...) Expand all
85 82
86 if (allowed) { 83 if (allowed) {
87 device::GeolocationProvider::GetInstance() 84 device::GeolocationProvider::GetInstance()
88 ->UserDidOptIntoLocationServices(); 85 ->UserDidOptIntoLocationServices();
89 } 86 }
90 } 87 }
91 88
92 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const { 89 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const {
93 return true; 90 return true;
94 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698