Skip to content

Commit

Permalink
Add a command switch for webtorrent
Browse files Browse the repository at this point in the history
  • Loading branch information
yrliou committed Nov 8, 2018
1 parent 9ccd1b0 commit 25bb585
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions browser/extensions/brave_component_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ void BraveComponentLoader::AddDefaultComponentExtensions(
}
#endif

base::FilePath brave_webtorrent_path(FILE_PATH_LITERAL(""));
brave_webtorrent_path =
brave_webtorrent_path.Append(FILE_PATH_LITERAL("brave_webtorrent"));
Add(IDR_BRAVE_WEBTORRENT, brave_webtorrent_path);
if (!command_line.HasSwitch(switches::kDisableWebTorrentExtension)) {
base::FilePath brave_webtorrent_path(FILE_PATH_LITERAL(""));
brave_webtorrent_path =
brave_webtorrent_path.Append(FILE_PATH_LITERAL("brave_webtorrent"));
Add(IDR_BRAVE_WEBTORRENT, brave_webtorrent_path);
}
}

} // namespace extensions
3 changes: 3 additions & 0 deletions common/brave_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const char kDisablePDFJSExtension[] = "disable-pdfjs-extension";
// Allows disabling the Tor client updater extension.
const char kDisableTorClientUpdaterExtension[] = "disable-tor-client-updater-extension";

// Allows disabling the WebTorrent extension.
const char kDisableWebTorrentExtension[] = "disable-webtorrent-extension";

// Enables Brave Sync. For now it is targeted to staging for QA tests, so
// is disabled by default for a while.
const char kEnableBraveSync[] = "enable-brave-sync";
Expand Down
2 changes: 2 additions & 0 deletions common/brave_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ extern const char kDisablePDFJSExtension[];

extern const char kDisableTorClientUpdaterExtension[];

extern const char kDisableWebTorrentExtension[];

extern const char kEnableBraveSync[];

extern const char kRewardsEnv[];
Expand Down

0 comments on commit 25bb585

Please sign in to comment.