-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2647 from brave/network_service_tor
NetworkService migration for Tor
- Loading branch information
Showing
79 changed files
with
1,416 additions
and
1,456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 18 additions & 13 deletions
31
browser/geolocation/brave_geolocation_permission_context.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,38 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/browser/geolocation/brave_geolocation_permission_context.h" | ||
|
||
#include "chrome/browser/profiles/profile.h" | ||
#include "components/content_settings/core/common/content_settings.h" | ||
#include "components/prefs/pref_service.h" | ||
#include "brave/common/tor/pref_names.h" | ||
|
||
BraveGeolocationPermissionContext::BraveGeolocationPermissionContext( | ||
Profile* profile) : GeolocationPermissionContext(profile) { | ||
Profile* profile) : GeolocationPermissionContext(profile) { | ||
} | ||
|
||
BraveGeolocationPermissionContext::~BraveGeolocationPermissionContext() { | ||
} | ||
|
||
void BraveGeolocationPermissionContext::DecidePermission( | ||
content::WebContents* web_contents, | ||
const PermissionRequestID& id, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin, | ||
bool user_gesture, | ||
const BrowserPermissionCallback& callback) { | ||
|
||
PrefService* prefs = profile()->GetPrefs(); | ||
if (prefs->HasPrefPath(tor::prefs::kProfileUsingTor) && | ||
prefs->GetBoolean(tor::prefs::kProfileUsingTor)) { | ||
content::WebContents* web_contents, | ||
const PermissionRequestID& id, | ||
const GURL& requesting_origin, | ||
const GURL& embedding_origin, | ||
bool user_gesture, | ||
const BrowserPermissionCallback& callback) { | ||
if (profile()->IsTorProfile()) { | ||
callback.Run(ContentSetting::CONTENT_SETTING_BLOCK); | ||
return; | ||
} | ||
|
||
return GeolocationPermissionContext::DecidePermission(web_contents, id, requesting_origin, embedding_origin, user_gesture, callback); | ||
return GeolocationPermissionContext::DecidePermission(web_contents, | ||
id, | ||
requesting_origin, | ||
embedding_origin, | ||
user_gesture, | ||
callback); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.