| 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 PermissionBubbleType 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 PermissionBubbleType enum in sync with this definition. |
| 22 enum class PermissionBubbleType { |
| 23 UNKNOWN, |
| 24 MULTIPLE, |
| 25 PERMISSION, |
| 26 QUOTA, |
| 27 DOWNLOAD, |
| 28 MEDIA_STREAM, |
| 29 REGISTER_PROTOCOL_HANDLER, |
| 30 // NUM must be the last value in the enum. |
| 31 NUM |
| 32 }; |
| 33 |
| 15 // Describes the interface a feature utilizing permission bubbles should | 34 // Describes the interface a feature utilizing permission bubbles should |
| 16 // implement. A class of this type is registered with the permission bubble | 35 // implement. A class of this type is registered with the permission bubble |
| 17 // manager to receive updates about the result of the permissions request | 36 // manager to receive updates about the result of the permissions request |
| 18 // from the bubble. It should live until it is unregistered or until | 37 // from the bubble. It should live until it is unregistered or until |
| 19 // RequestFinished is called. | 38 // RequestFinished is called. |
| 20 // Note that no particular guarantees are made about what exact UI surface | 39 // 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 | 40 // is presented to the user. The delegate may be coalesced with other bubble |
| 22 // requests, or depending on the situation, not shown at all. | 41 // requests, or depending on the situation, not shown at all. |
| 23 class PermissionBubbleRequest { | 42 class PermissionBubbleRequest { |
| 24 public: | 43 public: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 55 // Called when the user has cancelled the permission request. This | 74 // Called when the user has cancelled the permission request. This |
| 56 // corresponds to a denial, but is segregated in case the context needs to | 75 // 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. | 76 // be able to distinguish between an active refusal or an implicit refusal. |
| 58 virtual void Cancelled() = 0; | 77 virtual void Cancelled() = 0; |
| 59 | 78 |
| 60 // The bubble this request was associated with was answered by the user. | 79 // 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 | 80 // 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 | 81 // no further message from the permission bubble system. This method will |
| 63 // eventually be called on every request which is not unregistered. | 82 // eventually be called on every request which is not unregistered. |
| 64 virtual void RequestFinished() = 0; | 83 virtual void RequestFinished() = 0; |
| 84 |
| 85 virtual PermissionBubbleType GetPermissionBubbleType() const; |
| 65 }; | 86 }; |
| 66 | 87 |
| 67 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ | 88 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_ |
| OLD | NEW |