Skip to content

Commit

Permalink
Add --disable_pdfjs-extension switch
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Jun 13, 2018
1 parent 2711d00 commit 27c4622
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion browser/extensions/brave_extension_management.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "brave/browser/extensions/brave_extension_management.h"

#include "base/command_line.h"
#include "brave/common/brave_switches.h"
#include "brave/common/extensions/extension_constants.h"
#include "brave/extensions/browser/brave_extension_provider.h"
#include "chrome/browser/extensions/external_policy_loader.h"
Expand All @@ -17,7 +19,11 @@ BraveExtensionManagement::BraveExtensionManagement(
: ExtensionManagement(pref_service, is_signin_profile) {
providers_.push_back(
std::make_unique<BraveExtensionProvider>());
RegisterForceInstalledExtensions();
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (!command_line.HasSwitch(switches::kDisablePDFJSExtension)) {
RegisterForceInstalledExtensions();
}
}

BraveExtensionManagement::~BraveExtensionManagement() {
Expand Down
3 changes: 3 additions & 0 deletions common/brave_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ namespace switches {
// in debug mode with auto-reloading.
const char kDisableBraveExtension[] = "disable-brave-extension";

// Allows disabling the PDFJS extension.
const char kDisablePDFJSExtension[] = "disable-pdfjs-extension";

// This switch enables update module(Sparkle).
// When you use this flag for update test, make sure to fix the feed URL
// |brave_feed_url| in brave/brave_init_settings.gni.
Expand Down
2 changes: 2 additions & 0 deletions common/brave_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace switches {
// alongside the definition of their values in the .cc file.
extern const char kDisableBraveExtension[];

extern const char kDisablePDFJSExtension[];

extern const char kEnableBraveUpdateTest[];

} // namespace switches
Expand Down

0 comments on commit 27c4622

Please sign in to comment.