Chromium Code Reviews| 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_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "content/public/browser/permission_type.h" | |
| 9 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 10 | 11 |
| 11 namespace gfx { | 12 namespace gfx { |
| 12 enum class VectorIconId; | 13 enum class VectorIconId; |
| 13 } | 14 } |
| 14 | 15 |
| 15 // Used for UMA to record the types of permission prompts shown. | 16 // Used for UMA to record the types of permission prompts shown. |
| 16 // This corresponds to the PermissionBubbleType enum in | 17 // This corresponds to the PermissionBubbleType enum in |
| 17 // src/tools/metrics/histograms.xml. The usual rules of updating UMA values | 18 // src/tools/metrics/histograms.xml. The usual rules of updating UMA values |
| 18 // applies to this enum: | 19 // applies to this enum: |
| 19 // - don't remove values | 20 // - don't remove values |
| 20 // - only ever add values at the end | 21 // - only ever add values at the end |
| 21 // - keep the PermissionBubbleType enum in sync with this definition. | 22 // - keep the PermissionBubbleType enum in sync with this definition. |
| 22 enum class PermissionBubbleType { | 23 enum class PermissionBubbleType { |
| 23 UNKNOWN, | 24 UNKNOWN, |
| 24 MULTIPLE, | 25 MULTIPLE, |
| 25 PERMISSION, | 26 UNUSED_PERMISSION, |
| 26 QUOTA, | 27 QUOTA, |
| 27 DOWNLOAD, | 28 DOWNLOAD, |
| 28 MEDIA_STREAM, | 29 MEDIA_STREAM, |
| 29 REGISTER_PROTOCOL_HANDLER, | 30 REGISTER_PROTOCOL_HANDLER, |
| 31 PERMISSION_GEOLOCATION, | |
|
felt
2016/04/27 15:37:24
nit: why are these (but not the others) prefixed w
benwells
2016/04/28 00:16:59
No big reason, just because they correspond to Per
| |
| 32 PERMISSION_MIDI_SYSEX, | |
| 33 PERMISSION_NOTIFICATIONS, | |
| 34 PERMISSION_PROTECTED_MEDIA_IDENTIFIER, | |
| 35 PERMISSION_PUSH_MESSAGING, | |
| 30 // NUM must be the last value in the enum. | 36 // NUM must be the last value in the enum. |
| 31 NUM | 37 NUM |
| 32 }; | 38 }; |
| 33 | 39 |
| 34 // Describes the interface a feature utilizing permission bubbles should | 40 // Describes the interface a feature utilizing permission bubbles should |
| 35 // implement. A class of this type is registered with the permission bubble | 41 // implement. A class of this type is registered with the permission bubble |
| 36 // manager to receive updates about the result of the permissions request | 42 // manager to receive updates about the result of the permissions request |
| 37 // from the bubble. It should live until it is unregistered or until | 43 // from the bubble. It should live until it is unregistered or until |
| 38 // RequestFinished is called. | 44 // RequestFinished is called. |
| 39 // Note that no particular guarantees are made about what exact UI surface | 45 // Note that no particular guarantees are made about what exact UI surface |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 // corresponds to a denial, but is segregated in case the context needs to | 81 // corresponds to a denial, but is segregated in case the context needs to |
| 76 // be able to distinguish between an active refusal or an implicit refusal. | 82 // be able to distinguish between an active refusal or an implicit refusal. |
| 77 virtual void Cancelled() = 0; | 83 virtual void Cancelled() = 0; |
| 78 | 84 |
| 79 // The bubble this request was associated with was answered by the user. | 85 // The bubble this request was associated with was answered by the user. |
| 80 // It is safe for the request to be deleted at this point -- it will receive | 86 // It is safe for the request to be deleted at this point -- it will receive |
| 81 // no further message from the permission bubble system. This method will | 87 // no further message from the permission bubble system. This method will |
| 82 // eventually be called on every request which is not unregistered. | 88 // eventually be called on every request which is not unregistered. |
| 83 virtual void RequestFinished() = 0; | 89 virtual void RequestFinished() = 0; |
| 84 | 90 |
| 91 // Used to record UMA metrics for bubbles. | |
| 85 virtual PermissionBubbleType GetPermissionBubbleType() const; | 92 virtual PermissionBubbleType GetPermissionBubbleType() const; |
| 86 }; | 93 }; |
| 87 | 94 |
| 88 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ | 95 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ |
| OLD | NEW |