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

Unified Diff: chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h

Issue 2858013002: PS - Showing permission prompt for activeTab (Closed)
Patch Set: Update a unittest (.mm) Created 3 years, 7 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
Index: chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h
diff --git a/chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h b/chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..83ecfce1e9e2ba9397654cf490436a4c29c4864d
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_DELEGATE_CHROMEOS_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_DELEGATE_CHROMEOS_H_
+
+#include "base/macros.h"
+#include "chrome/browser/extensions/active_tab_permission_granter.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace extensions {
+class Extension;
+
+// In Public Sessions, apps and extensions are force-installed by admin policy
+// so the user does not get a chance to review the permissions for these apps.
+// This is not acceptable from a security standpoint, so we show a permission
+// prompt the first time an extension tries to use activeTab permission (unless
+// the extension is whitelisted).
+class ActiveTabPermissionGranterDelegateChromeOS
+ : public ActiveTabPermissionGranter::Delegate {
+ public:
+ ActiveTabPermissionGranterDelegateChromeOS();
+ ~ActiveTabPermissionGranterDelegateChromeOS() override;
+
+ // ActiveTabPermissionGranter::Delegate
+ bool ShouldGrantActiveTab(const Extension* extension,
+ content::WebContents* web_contents) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionGranterDelegateChromeOS);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_ACTIVE_TAB_PERMISSION_GRANTER_DELEGATE_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698