| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_TEST_UTIL_H
_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H
_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H
_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H
_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" | 10 #include "chrome/browser/ui/website_settings/permission_prompt.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class CommandLine; | 13 class CommandLine; |
| 14 } | 14 } |
| 15 class PermissionRequest; | 15 class PermissionRequest; |
| 16 class Browser; | 16 class Browser; |
| 17 | 17 |
| 18 class TestPermissionBubbleViewDelegate : public PermissionBubbleView::Delegate { | 18 class TestPermissionBubbleViewDelegate : public PermissionPrompt::Delegate { |
| 19 public: | 19 public: |
| 20 TestPermissionBubbleViewDelegate(); | 20 TestPermissionBubbleViewDelegate(); |
| 21 | 21 |
| 22 void ToggleAccept(int, bool) override {} | 22 void ToggleAccept(int, bool) override {} |
| 23 void Accept() override {} | 23 void Accept() override {} |
| 24 void Deny() override {} | 24 void Deny() override {} |
| 25 void Closing() override {} | 25 void Closing() override {} |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate); | 28 DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // Use this class to test on a default window or an app window. Inheriting from | 31 // Use this class to test on a default window or an app window. Inheriting from |
| 32 // ExtensionBrowserTest allows us to easily load and launch apps, and doesn't | 32 // ExtensionBrowserTest allows us to easily load and launch apps, and doesn't |
| 33 // really add any extra work. | 33 // really add any extra work. |
| 34 class PermissionBubbleBrowserTest : public ExtensionBrowserTest { | 34 class PermissionBubbleBrowserTest : public ExtensionBrowserTest { |
| 35 public: | 35 public: |
| 36 PermissionBubbleBrowserTest(); | 36 PermissionBubbleBrowserTest(); |
| 37 ~PermissionBubbleBrowserTest() override; | 37 ~PermissionBubbleBrowserTest() override; |
| 38 | 38 |
| 39 void SetUpOnMainThread() override; | 39 void SetUpOnMainThread() override; |
| 40 | 40 |
| 41 // Opens an app window, and returns the associated browser. | 41 // Opens an app window, and returns the associated browser. |
| 42 Browser* OpenExtensionAppWindow(); | 42 Browser* OpenExtensionAppWindow(); |
| 43 | 43 |
| 44 std::vector<PermissionRequest*> requests() { return requests_.get(); } | 44 std::vector<PermissionRequest*> requests() { return requests_.get(); } |
| 45 std::vector<bool> accept_states() { return accept_states_; } | 45 std::vector<bool> accept_states() { return accept_states_; } |
| 46 PermissionBubbleView::Delegate* test_delegate() { return &test_delegate_; } | 46 PermissionPrompt::Delegate* test_delegate() { return &test_delegate_; } |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 TestPermissionBubbleViewDelegate test_delegate_; | 49 TestPermissionBubbleViewDelegate test_delegate_; |
| 50 ScopedVector<PermissionRequest> requests_; | 50 ScopedVector<PermissionRequest> requests_; |
| 51 std::vector<bool> accept_states_; | 51 std::vector<bool> accept_states_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleBrowserTest); | 53 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleBrowserTest); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // Use this class to test on a kiosk window. | 56 // Use this class to test on a kiosk window. |
| 57 class PermissionBubbleKioskBrowserTest : public PermissionBubbleBrowserTest { | 57 class PermissionBubbleKioskBrowserTest : public PermissionBubbleBrowserTest { |
| 58 public: | 58 public: |
| 59 PermissionBubbleKioskBrowserTest(); | 59 PermissionBubbleKioskBrowserTest(); |
| 60 ~PermissionBubbleKioskBrowserTest() override; | 60 ~PermissionBubbleKioskBrowserTest() override; |
| 61 | 61 |
| 62 void SetUpCommandLine(base::CommandLine* command_line) override; | 62 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleKioskBrowserTest); | 64 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleKioskBrowserTest); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTI
L_H_ | 67 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTI
L_H_ |
| OLD | NEW |