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

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: removed the policy 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..6dffd9cb459c2c0dad1ee890e8b8796b46c46055 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -340,14 +340,20 @@ 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;
}
+
+ const Extension* extension =
+ ExtensionRegistry::Get(profile)->enabled_extensions().GetByID(
+ extension_id);
+ if (Manifest::IsPolicyLocation(extension->location()))
Devlin 2017/02/23 21:46:40 nit: Can we add a comment here like: // We allow p
+ 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