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

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

Issue 2258763002: Add a feature-controlled persistence checkbox to geolocation prompts on desktop Views platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-infobardelegate-clean
Patch Set: Fix for multiple requests Created 4 years, 4 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/permission_request.h
diff --git a/chrome/browser/permissions/permission_request.h b/chrome/browser/permissions/permission_request.h
index 98453d73d5da81dd74329a3781bc296c8899a67c..628f053bae3513ade9e71fe5162fc6777b667c0b 100644
--- a/chrome/browser/permissions/permission_request.h
+++ b/chrome/browser/permissions/permission_request.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_
#define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_
+#include "base/macros.h"
#include "base/strings/string16.h"
#include "content/public/browser/permission_type.h"
#include "url/gurl.h"
@@ -58,6 +59,7 @@ enum class PermissionRequestGestureType {
// requests, or depending on the situation, not shown at all.
class PermissionRequest {
public:
+ PermissionRequest();
virtual ~PermissionRequest() {}
// Returns a vector icon id if the icon should be drawn as a vector
@@ -94,6 +96,9 @@ class PermissionRequest {
// eventually be called on every request which is not unregistered.
virtual void RequestFinished() = 0;
+ // True if a persistence toggle should be shown in the UI for this request.
+ virtual bool ShouldShowPersistenceToggle() const;
+
// Used to record UMA metrics for permission requests.
virtual PermissionRequestType GetPermissionRequestType() const;
@@ -101,6 +106,17 @@ class PermissionRequest {
// To keep things simple this metric is only recorded for the most popular
// request types.
virtual PermissionRequestGestureType GetGestureType() const;
+
+ void set_persist(bool persist) { persist_ = persist; }
+
+ protected:
+ bool persist() const { return persist_; }
+
+ private:
+ // Whether or not the response for this prompt should be persisted.
+ bool persist_;
Sergey Ulanov 2016/08/19 17:11:53 PermissionRequest is an interface and style guide
dominickn 2016/08/20 01:19:24 PermissionRequest doesn't actually satisfy the con
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionRequest);
};
#endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_
« no previous file with comments | « chrome/browser/permissions/permission_context_base_unittest.cc ('k') | chrome/browser/permissions/permission_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698