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

Unified Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 2696283007: DevTools: disable the Chrome tab debugging warning for force-installed extensions. (Closed)
Patch Set: illegal access in the tests. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/debugger/debugger_api.cc
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index b0ad14b977535ad6f3d61b0d1550461c95c03666..88d7f073bdee31a7751c8025b06fcbdd4b995e03 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -341,13 +341,23 @@ ExtensionDevToolsClientHost::ExtensionDevToolsClientHost(
// Attach to debugger and tell it we are ready.
agent_host_->AttachClient(this);
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kSilentDebuggerExtensionAPI)) {
- infobar_ = ExtensionDevToolsInfoBar::Create(
- extension_id, extension_name, this,
- base::Bind(&ExtensionDevToolsClientHost::InfoBarDismissed,
- base::Unretained(this)));
+ return;
}
+
+ // We allow policy-installed extensions to circumvent the normal
+ // infobar warning. See crbug.com/693621.
+ const Extension* extension =
+ ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(
+ extension_id);
+ if (extension && Manifest::IsPolicyLocation(extension->location()))
+ return;
+
+ infobar_ = ExtensionDevToolsInfoBar::Create(
+ extension_id, extension_name, this,
+ base::Bind(&ExtensionDevToolsClientHost::InfoBarDismissed,
+ base::Unretained(this)));
}
ExtensionDevToolsClientHost::~ExtensionDevToolsClientHost() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698