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

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

Issue 2192683003: Revert of Reland: Geolocation: move from content/browser to device/ (patchset #2 id:20001 of https:… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2810
Patch Set: Created 4 years, 4 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
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | chrome/test/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/geolocation_provider.h"
12 #include "content/public/browser/permission_type.h" 13 #include "content/public/browser/permission_type.h"
13 #include "content/public/browser/render_frame_host.h" 14 #include "content/public/browser/render_frame_host.h"
14 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
15 #include "device/geolocation/geolocation_provider.h"
16 16
17 GeolocationPermissionContext::GeolocationPermissionContext(Profile* profile) 17 GeolocationPermissionContext::GeolocationPermissionContext(Profile* profile)
18 : PermissionContextBase(profile, 18 : PermissionContextBase(profile,
19 content::PermissionType::GEOLOCATION, 19 content::PermissionType::GEOLOCATION,
20 CONTENT_SETTINGS_TYPE_GEOLOCATION), 20 CONTENT_SETTINGS_TYPE_GEOLOCATION),
21 extensions_context_(profile) {} 21 extensions_context_(profile) {}
22 22
23 GeolocationPermissionContext::~GeolocationPermissionContext() { 23 GeolocationPermissionContext::~GeolocationPermissionContext() {
24 } 24 }
25 25
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 TabSpecificContentSettings::GetForFrame(id.render_process_id(), 76 TabSpecificContentSettings::GetForFrame(id.render_process_id(),
77 id.render_frame_id()); 77 id.render_frame_id());
78 78
79 // WebContents might not exist (extensions) or no longer exist. In which case, 79 // WebContents might not exist (extensions) or no longer exist. In which case,
80 // TabSpecificContentSettings will be null. 80 // TabSpecificContentSettings will be null.
81 if (content_settings) 81 if (content_settings)
82 content_settings->OnGeolocationPermissionSet( 82 content_settings->OnGeolocationPermissionSet(
83 requesting_frame.GetOrigin(), allowed); 83 requesting_frame.GetOrigin(), allowed);
84 84
85 if (allowed) { 85 if (allowed) {
86 device::GeolocationProvider::GetInstance() 86 content::GeolocationProvider::GetInstance()
87 ->UserDidOptIntoLocationServices(); 87 ->UserDidOptIntoLocationServices();
88 } 88 }
89 } 89 }
90 90
91 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const { 91 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const {
92 return true; 92 return true;
93 } 93 }
OLDNEW
« no previous file with comments | « chrome/browser/geolocation/geolocation_browsertest.cc ('k') | chrome/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698