| 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_MOCK_PERMISSION_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_MOCK_PERMISSION_REQUEST_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_MOCK_PERMISSION_REQUEST_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_MOCK_PERMISSION_REQUEST_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "chrome/browser/permissions/permission_request.h" | 9 #include "chrome/browser/permissions/permission_request.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 class MockPermissionRequest : public PermissionRequest { | 12 class MockPermissionRequest : public PermissionRequest { |
| 13 public: | 13 public: |
| 14 MockPermissionRequest(); | 14 MockPermissionRequest(); |
| 15 explicit MockPermissionRequest(const std::string& text); | 15 explicit MockPermissionRequest(const std::string& text); |
| 16 MockPermissionRequest(const std::string& text, | 16 MockPermissionRequest(const std::string& text, |
| 17 PermissionRequestType request_type); | 17 PermissionRequestType request_type, |
| 18 PermissionRequestGestureType gesture_type); |
| 18 MockPermissionRequest(const std::string& text, const GURL& url); | 19 MockPermissionRequest(const std::string& text, const GURL& url); |
| 19 MockPermissionRequest(const std::string& text, | 20 MockPermissionRequest(const std::string& text, |
| 20 const std::string& accept_label, | 21 const std::string& accept_label, |
| 21 const std::string& deny_label); | 22 const std::string& deny_label); |
| 22 | 23 |
| 23 ~MockPermissionRequest() override; | 24 ~MockPermissionRequest() override; |
| 24 | 25 |
| 25 int GetIconId() const override; | 26 int GetIconId() const override; |
| 26 base::string16 GetMessageTextFragment() const override; | 27 base::string16 GetMessageTextFragment() const override; |
| 27 GURL GetOrigin() const override; | 28 GURL GetOrigin() const override; |
| 28 | 29 |
| 29 void PermissionGranted() override; | 30 void PermissionGranted() override; |
| 30 void PermissionDenied() override; | 31 void PermissionDenied() override; |
| 31 void Cancelled() override; | 32 void Cancelled() override; |
| 32 void RequestFinished() override; | 33 void RequestFinished() override; |
| 33 PermissionRequestType GetPermissionRequestType() const override; | 34 PermissionRequestType GetPermissionRequestType() const override; |
| 35 PermissionRequestGestureType GetGestureType() const override; |
| 34 | 36 |
| 35 bool granted(); | 37 bool granted(); |
| 36 bool cancelled(); | 38 bool cancelled(); |
| 37 bool finished(); | 39 bool finished(); |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 MockPermissionRequest(const std::string& text, | 42 MockPermissionRequest(const std::string& text, |
| 41 const std::string& accept_label, | 43 const std::string& accept_label, |
| 42 const std::string& deny_label, | 44 const std::string& deny_label, |
| 43 const GURL& url, | 45 const GURL& url, |
| 44 PermissionRequestType request_type); | 46 PermissionRequestType request_type, |
| 47 PermissionRequestGestureType gesture_type); |
| 45 bool granted_; | 48 bool granted_; |
| 46 bool cancelled_; | 49 bool cancelled_; |
| 47 bool finished_; | 50 bool finished_; |
| 48 PermissionRequestType request_type_; | 51 PermissionRequestType request_type_; |
| 52 PermissionRequestGestureType gesture_type_; |
| 49 | 53 |
| 50 base::string16 text_; | 54 base::string16 text_; |
| 51 base::string16 accept_label_; | 55 base::string16 accept_label_; |
| 52 base::string16 deny_label_; | 56 base::string16 deny_label_; |
| 53 GURL origin_; | 57 GURL origin_; |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 #endif // CHROME_BROWSER_PERMISSIONS_MOCK_PERMISSION_REQUEST_H_ | 60 #endif // CHROME_BROWSER_PERMISSIONS_MOCK_PERMISSION_REQUEST_H_ |
| OLD | NEW |