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

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

Issue 2794803003: PS - Remove Clipboard Read permission from extensions in Public Sessions (except for whitelisted on… (Closed)
Patch Set: Added tests Created 3 years, 8 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/permissions_updater_delegate_chromeos.h
diff --git a/chrome/browser/chromeos/extensions/permissions_updater_delegate_chromeos.h b/chrome/browser/chromeos/extensions/permissions_updater_delegate_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc1c56e17aa6112c23545070f1539d05a600b2f9
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/permissions_updater_delegate_chromeos.h
@@ -0,0 +1,41 @@
+// 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_PERMISSIONS_UPDATER_DELEGATE_CHROMEOS_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_PERMISSIONS_UPDATER_DELEGATE_CHROMEOS_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "chrome/browser/extensions/permissions_updater.h"
+
+namespace extensions {
+
+class Extension;
+class PermissionSet;
+
+// 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 remove ClipboardRead
Devlin 2017/04/08 00:30:51 This comment starts to get very specific, and is p
Ivan Šandrk 2017/04/10 12:04:35 Done.
+// permission from them (except for whitelisted ones - eg. remote desktop
+// clients). This forceful removal of permission is safe since the clipboard
+// pasting code checks for this permission before doing the paste (the end
+// result is just an empty paste).
+class PermissionsUpdaterDelegateChromeOS : public PermissionsUpdater::Delegate {
+ public:
+ PermissionsUpdaterDelegateChromeOS();
+ ~PermissionsUpdaterDelegateChromeOS() override;
+
+ // PermissionsUpdater::Delegate
+ void InitializePermissions(
+ const Extension* extension,
+ std::unique_ptr<const PermissionSet>* granted_permissions) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PermissionsUpdaterDelegateChromeOS);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_PERMISSIONS_UPDATER_DELEGATE_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698