| 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 "content/public/browser/permission_type.h" | 10 #include "content/public/browser/permission_type.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class PermissionRequest { | 61 class PermissionRequest { |
| 62 public: | 62 public: |
| 63 PermissionRequest(); | 63 PermissionRequest(); |
| 64 virtual ~PermissionRequest() {} | 64 virtual ~PermissionRequest() {} |
| 65 | 65 |
| 66 // Returns a vector icon id if the icon should be drawn as a vector | 66 // Returns a vector icon id if the icon should be drawn as a vector |
| 67 // resource. Otherwise, returns VECTOR_ICON_NONE. | 67 // resource. Otherwise, returns VECTOR_ICON_NONE. |
| 68 virtual gfx::VectorIconId GetVectorIconId() const; | 68 virtual gfx::VectorIconId GetVectorIconId() const; |
| 69 | 69 |
| 70 // The icon to use next to the message text fragment in the permission bubble. | 70 // The icon to use next to the message text fragment in the permission bubble. |
| 71 // Must be a valid icon of size 18x18. | 71 // TODO(estade): remove this in favor of GetVectorIconId(). |
| 72 virtual int GetIconId() const = 0; | 72 virtual int GetIconId() const; |
| 73 | 73 |
| 74 // Returns the shortened prompt text for this permission. Must be phrased | 74 // Returns the shortened prompt text for this permission. Must be phrased |
| 75 // as a heading, e.g. "Location", or "Camera". The permission bubble may | 75 // as a heading, e.g. "Location", or "Camera". The permission bubble may |
| 76 // coalesce different requests, and if it does, this text will be displayed | 76 // coalesce different requests, and if it does, this text will be displayed |
| 77 // next to an image and indicate the user grants the permission. | 77 // next to an image and indicate the user grants the permission. |
| 78 virtual base::string16 GetMessageTextFragment() const = 0; | 78 virtual base::string16 GetMessageTextFragment() const = 0; |
| 79 | 79 |
| 80 // Get the origin on whose behalf this permission request is being made. | 80 // Get the origin on whose behalf this permission request is being made. |
| 81 virtual GURL GetOrigin() const = 0; | 81 virtual GURL GetOrigin() const = 0; |
| 82 | 82 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 bool persist() const { return persist_; } | 114 bool persist() const { return persist_; } |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 // Whether or not the response for this prompt should be persisted. | 117 // Whether or not the response for this prompt should be persisted. |
| 118 bool persist_; | 118 bool persist_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(PermissionRequest); | 120 DISALLOW_COPY_AND_ASSIGN(PermissionRequest); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ | 123 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_ |
| OLD | NEW |