| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "components/content_settings/core/common/content_settings_types.h" |
| 10 #include "content/public/browser/permission_type.h" | 11 #include "content/public/browser/permission_type.h" |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 enum class VectorIconId; | 15 enum class VectorIconId; |
| 15 } | 16 } |
| 16 | 17 |
| 17 // Used for UMA to record the types of permission prompts shown. | 18 // Used for UMA to record the types of permission prompts shown. |
| 18 // This corresponds to the PermissionRequestType enum in | 19 // This corresponds to the PermissionRequestType enum in |
| 19 // src/tools/metrics/histograms.xml. The usual rules of updating UMA values | 20 // src/tools/metrics/histograms.xml. The usual rules of updating UMA values |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 virtual bool ShouldShowPersistenceToggle() const; | 105 virtual bool ShouldShowPersistenceToggle() const; |
| 105 | 106 |
| 106 // Used to record UMA metrics for permission requests. | 107 // Used to record UMA metrics for permission requests. |
| 107 virtual PermissionRequestType GetPermissionRequestType() const; | 108 virtual PermissionRequestType GetPermissionRequestType() const; |
| 108 | 109 |
| 109 // Used to record UMA for whether requests are associated with a user gesture. | 110 // Used to record UMA for whether requests are associated with a user gesture. |
| 110 // To keep things simple this metric is only recorded for the most popular | 111 // To keep things simple this metric is only recorded for the most popular |
| 111 // request types. | 112 // request types. |
| 112 virtual PermissionRequestGestureType GetGestureType() const; | 113 virtual PermissionRequestGestureType GetGestureType() const; |
| 113 | 114 |
| 115 // Used on Android to determine what Android OS permissions are needed for |
| 116 // this permission request. |
| 117 virtual ContentSettingsType GetContentSettingsType() const; |
| 118 |
| 114 void set_persist(bool persist) { persist_ = persist; } | 119 void set_persist(bool persist) { persist_ = persist; } |
| 115 | 120 |
| 116 protected: | 121 protected: |
| 117 bool persist() const { return persist_; } | 122 bool persist() const { return persist_; } |
| 118 | 123 |
| 119 private: | 124 private: |
| 120 // Whether or not the response for this prompt should be persisted. | 125 // Whether or not the response for this prompt should be persisted. |
| 121 bool persist_; | 126 bool persist_; |
| 122 | 127 |
| 123 DISALLOW_COPY_AND_ASSIGN(PermissionRequest); | 128 DISALLOW_COPY_AND_ASSIGN(PermissionRequest); |
| 124 }; | 129 }; |
| 125 | 130 |
| 126 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ | 131 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ |
| OLD | NEW |