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

Unified Diff: chrome/browser/permissions/chooser_permission_context_base.h

Issue 1382783002: Store USB device permissions in website settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert WebUSBPermissionStore to a PermissionContext. Created 5 years, 2 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/permissions/chooser_permission_context_base.h
diff --git a/chrome/browser/permissions/chooser_permission_context_base.h b/chrome/browser/permissions/chooser_permission_context_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc8f685d3008c1efa21c6f5c96e62d58f72612e9
--- /dev/null
+++ b/chrome/browser/permissions/chooser_permission_context_base.h
@@ -0,0 +1,33 @@
+// Copyright 2015 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_PERMISSIONS_CHOOSER_PERMISSION_CONTEXT_BASE_H_
+#define CHROME_BROWSER_PERMISSIONS_CHOOSER_PERMISSION_CONTEXT_BASE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/permissions/permission_context_base.h"
+
+namespace base {
+class DictionaryValue;
+class ListValue;
+class Value;
+}
+
+class ChooserPermissionContextBase : public PermissionContextBase {
raymes 2015/10/06 05:28:20 Mounir should have some thoughts about inheriting
Reilly Grant (use Gerrit) 2015/10/06 20:45:30 Alright.
+ public:
+ ChooserPermissionContextBase(Profile* profile,
+ ContentSettingsType permission_type);
+ ~ChooserPermissionContextBase() override;
+
+ scoped_ptr<base::ListValue> GetChosenObjects(const GURL& origin);
raymes 2015/10/06 05:28:20 How is an "Object" defined? Would GetPreviouslyCh
Reilly Grant (use Gerrit) 2015/10/06 20:45:30 An object is defined by the subclass. For the bene
raymes 2015/10/07 04:48:29 Could we impose some structure on it? This might m
Bernhard Bauer 2015/10/12 11:03:48 Yes -- for example, a chooser-based geolocation pr
Reilly Grant (use Gerrit) 2015/10/12 15:37:48 My followup UI patch adds a virtual GetStringToDis
+ void GrantObjectPermission(const GURL& origin,
raymes 2015/10/06 05:28:20 Perhaps we should pass the top level and requestin
Reilly Grant (use Gerrit) 2015/10/06 20:45:30 Done.
+ scoped_ptr<base::Value> object);
+ void RevokeObjectPermission(const GURL& origin, const base::Value& object);
+
+ private:
+ scoped_ptr<base::DictionaryValue> GetWebsiteSetting(const GURL& origin);
+ void SetWebsiteSetting(const GURL& origin, scoped_ptr<base::Value> value);
+};
+
+#endif // CHROME_BROWSER_PERMISSIONS_CHOOSER_PERMISSION_CONTEXT_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698