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