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 "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 enum class VectorIconId; | 12 enum class VectorIconId; |
| 13 } | 13 } |
| 14 | 14 |
| 15 // Used for UMA to record the types of permission prompts shown. | |
| 16 // This corresponds to the PermissionPromptType enum in | |
| 17 // src/tools/metrics/histograms.xml. The usual rules of updating UMA values | |
| 18 // applies to this enum: | |
| 19 // - don't remove values | |
| 20 // - only ever add values at the end | |
| 21 // - keep the PermissionPromptType enum in sync with this definition. | |
|
felt
2016/04/18 21:15:14
"Your search - PermissionPromptType - did not matc
benwells
2016/04/19 00:09:24
I don't know of any way to get around needing the
felt
2016/04/19 00:21:19
Ohhhh, I missed that this was the name of the enum
| |
| 22 enum class PermissionBubbleType { | |
| 23 UNKNOWN, | |
| 24 MULTIPLE, | |
| 25 PERMISSION, | |
| 26 QUOTA, | |
| 27 DOWNLOAD, | |
| 28 MEDIA_STREAM, | |
| 29 REGISTER_PROTOCOL_HANDLER, | |
| 30 NUM | |
| 31 }; | |
| 32 | |
| 15 // Describes the interface a feature utilizing permission bubbles should | 33 // Describes the interface a feature utilizing permission bubbles should |
| 16 // implement. A class of this type is registered with the permission bubble | 34 // implement. A class of this type is registered with the permission bubble |
| 17 // manager to receive updates about the result of the permissions request | 35 // manager to receive updates about the result of the permissions request |
| 18 // from the bubble. It should live until it is unregistered or until | 36 // from the bubble. It should live until it is unregistered or until |
| 19 // RequestFinished is called. | 37 // RequestFinished is called. |
| 20 // Note that no particular guarantees are made about what exact UI surface | 38 // Note that no particular guarantees are made about what exact UI surface |
| 21 // is presented to the user. The delegate may be coalesced with other bubble | 39 // is presented to the user. The delegate may be coalesced with other bubble |
| 22 // requests, or depending on the situation, not shown at all. | 40 // requests, or depending on the situation, not shown at all. |
| 23 class PermissionBubbleRequest { | 41 class PermissionBubbleRequest { |
| 24 public: | 42 public: |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 55 // Called when the user has cancelled the permission request. This | 73 // Called when the user has cancelled the permission request. This |
| 56 // corresponds to a denial, but is segregated in case the context needs to | 74 // corresponds to a denial, but is segregated in case the context needs to |
| 57 // be able to distinguish between an active refusal or an implicit refusal. | 75 // be able to distinguish between an active refusal or an implicit refusal. |
| 58 virtual void Cancelled() = 0; | 76 virtual void Cancelled() = 0; |
| 59 | 77 |
| 60 // The bubble this request was associated with was answered by the user. | 78 // The bubble this request was associated with was answered by the user. |
| 61 // It is safe for the request to be deleted at this point -- it will receive | 79 // It is safe for the request to be deleted at this point -- it will receive |
| 62 // no further message from the permission bubble system. This method will | 80 // no further message from the permission bubble system. This method will |
| 63 // eventually be called on every request which is not unregistered. | 81 // eventually be called on every request which is not unregistered. |
| 64 virtual void RequestFinished() = 0; | 82 virtual void RequestFinished() = 0; |
| 83 | |
| 84 virtual PermissionBubbleType GetPermissionBubbleType() const; | |
| 65 }; | 85 }; |
| 66 | 86 |
| 67 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ | 87 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ |
| OLD | NEW |