-
Notifications
You must be signed in to change notification settings - Fork 909
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 #903 from brave/magnet_url
Load magnet url instead of searching
- Loading branch information
Showing
8 changed files
with
83 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
source_set("browser") { | ||
sources = [ | ||
"content_browser_client_helper.h", | ||
"webtorrent_util.cc", | ||
"webtorrent_util.h", | ||
] | ||
|
||
deps = [ | ||
"//base", | ||
"//brave/common", | ||
"//content/public/browser", | ||
"//extensions/browser", | ||
"//extensions/common", | ||
"//net", | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* 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/components/brave_webtorrent/browser/webtorrent_util.h" | ||
|
||
#include "brave/common/extensions/extension_constants.h" | ||
#include "chrome/browser/profiles/profile.h" | ||
#include "extensions/browser/extension_registry.h" | ||
|
||
namespace webtorrent { | ||
|
||
bool IsWebtorrentEnabled(content::BrowserContext* browser_context) { | ||
bool isTorProfile = | ||
Profile::FromBrowserContext(browser_context)->IsTorProfile(); | ||
extensions::ExtensionRegistry* registry = | ||
extensions::ExtensionRegistry::Get(browser_context); | ||
return !isTorProfile && | ||
registry->enabled_extensions().Contains(brave_webtorrent_extension_id); | ||
} | ||
|
||
} // webtorrent | ||
|
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* 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/. */ | ||
|
||
#ifndef BRAVE_COMPONENTS_BRAVE_WEBTORRENT_BROWSER_WEBTORRENT_UTIL_H_ | ||
#define BRAVE_COMPONENTS_BRAVE_WEBTORRENT_BROWSER_WEBTORRENT_UTIL_H_ | ||
|
||
namespace content { | ||
class BrowserContext; | ||
} | ||
|
||
namespace webtorrent { | ||
|
||
bool IsWebtorrentEnabled(content::BrowserContext* browser_context); | ||
|
||
} // webtorrent | ||
|
||
#endif // BRAVE_COMPONENTS_BRAVE_WEBTORRENT_BROWSER_WEBTORRENT_UTIL_H_ |