summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/website_settings/permission_bubble_request.h
diff options
context:
space:
mode:
authorgbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-10 06:39:53 +0000
committergbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-10 06:39:53 +0000
commitd23cdeee7491760098a36fd79e192500d8722570 (patch)
tree0859897b2b19b20059a0f726a151ffe26536d543 /chrome/browser/ui/website_settings/permission_bubble_request.h
parent6b81e34b959bf55750a4960adc7e952a497087c1 (diff)
downloadchromium_src-d23cdeee7491760098a36fd79e192500d8722570.zip
chromium_src-d23cdeee7491760098a36fd79e192500d8722570.tar.gz
chromium_src-d23cdeee7491760098a36fd79e192500d8722570.tar.bz2
[WebsiteSettings] Change permission bubble API to adapt to new mocks.
This adds cancellation ability for the clients that will need it. Adds user gesture awareness to the API. Removes button customization. Adds icons. Some code reorganization as well. R=leng@google.com BUG=332115 Review URL: https://codereview.chromium.org/176053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/website_settings/permission_bubble_request.h')
-rw-r--r--chrome/browser/ui/website_settings/permission_bubble_request.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/chrome/browser/ui/website_settings/permission_bubble_request.h b/chrome/browser/ui/website_settings/permission_bubble_request.h
index 4beec27..8093515 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_request.h
+++ b/chrome/browser/ui/website_settings/permission_bubble_request.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_REQUEST_H_
#include "base/strings/string16.h"
+#include "url/gurl.h"
// Describes the interface a feature utilizing permission bubbles should
// implement. A class of this type is registered with the permission bubble
@@ -19,31 +20,27 @@ class PermissionBubbleRequest {
public:
virtual ~PermissionBubbleRequest() {}
+ // The icon to use next to the message text fragment in the permission bubble.
+ // Must be a valid icon of size 16x16. (TODO(gbillock): tbd size)
+ virtual int GetIconID() const = 0;
+
// Returns the full prompt text for this permission. This is the only text
// that will be shown in the single-permission case and should be phrased
// positively as a complete sentence.
virtual base::string16 GetMessageText() const = 0;
// Returns the shortened prompt text for this permission. Must be phrased
- // positively -- the permission bubble may coalesce different requests, and
- // if it does, this text will be displayed next to a bullet or checkbox
- // indicating the user grants the permission.
+ // as a heading, e.g. "Location", or "Camera". The permission bubble may
+ // coalesce different requests, and if it does, this text will be displayed
+ // next to an image and indicate the user grants the permission.
virtual base::string16 GetMessageTextFragment() const = 0;
- // May return alternative text for the accept button in the case where this
- // single permission request is triggered in the bubble. If it returns an
- // empty string the default is used.
- // If the permission request is coalesced, the text will revert to the default
- // "Accept"-alike, so the message text must be clear enough for users to
- // understand even if this text is not used.
- virtual base::string16 GetAlternateAcceptButtonText() const = 0;
+ // Get whether this request was accompanied by a user gesture. User gestured
+ // permissions requests will not be suppressed.
+ virtual bool HasUserGesture() const = 0;
- // May return alternative text for the deny button in the case where this
- // single permission request is triggered in the bubble. If it returns an
- // empty string the default is used. This text may not be used at all,
- // so the |GetMessageText()| prompt should be clear enough to convey the
- // permission request with generic button text.
- virtual base::string16 GetAlternateDenyButtonText() const = 0;
+ // Get the hostname on whose behalf this permission request is being made.
+ virtual GURL GetRequestingHostname() const = 0;
// Called when the user has granted the requested permission.
virtual void PermissionGranted() = 0;