Chromium Code Reviews| 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 <memory> | |
| 9 #include <vector> | |
| 10 | |
| 8 #include "base/macros.h" | 11 #include "base/macros.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 12 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/ui/website_settings/permission_prompt.h" | 13 #include "chrome/browser/ui/website_settings/permission_prompt.h" |
| 11 | 14 |
| 12 namespace base { | 15 namespace base { |
| 13 class CommandLine; | 16 class CommandLine; |
| 14 } | 17 } |
| 15 class PermissionRequest; | 18 class PermissionRequest; |
| 16 class Browser; | 19 class Browser; |
| 17 | 20 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 35 class PermissionBubbleBrowserTest : public ExtensionBrowserTest { | 38 class PermissionBubbleBrowserTest : public ExtensionBrowserTest { |
| 36 public: | 39 public: |
| 37 PermissionBubbleBrowserTest(); | 40 PermissionBubbleBrowserTest(); |
| 38 ~PermissionBubbleBrowserTest() override; | 41 ~PermissionBubbleBrowserTest() override; |
| 39 | 42 |
| 40 void SetUpOnMainThread() override; | 43 void SetUpOnMainThread() override; |
| 41 | 44 |
| 42 // Opens an app window, and returns the associated browser. | 45 // Opens an app window, and returns the associated browser. |
| 43 Browser* OpenExtensionAppWindow(); | 46 Browser* OpenExtensionAppWindow(); |
| 44 | 47 |
| 45 std::vector<PermissionRequest*> requests() { return requests_.get(); } | 48 std::vector<PermissionRequest*> requests() { |
|
Nico
2017/01/03 18:12:35
probably now big enough to be out-of-line?
Avi (use Gerrit)
2017/01/03 22:54:53
Done.
| |
| 49 std::vector<PermissionRequest*> result; | |
| 50 for (const auto& request : requests_) | |
| 51 result.push_back(request.get()); | |
| 52 return result; | |
| 53 } | |
| 46 std::vector<bool> accept_states() { return accept_states_; } | 54 std::vector<bool> accept_states() { return accept_states_; } |
| 47 PermissionPrompt::Delegate* test_delegate() { return &test_delegate_; } | 55 PermissionPrompt::Delegate* test_delegate() { return &test_delegate_; } |
| 48 | 56 |
| 49 private: | 57 private: |
| 50 TestPermissionBubbleViewDelegate test_delegate_; | 58 TestPermissionBubbleViewDelegate test_delegate_; |
| 51 ScopedVector<PermissionRequest> requests_; | 59 std::vector<std::unique_ptr<PermissionRequest>> requests_; |
| 52 std::vector<bool> accept_states_; | 60 std::vector<bool> accept_states_; |
| 53 | 61 |
| 54 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleBrowserTest); | 62 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleBrowserTest); |
| 55 }; | 63 }; |
| 56 | 64 |
| 57 // Use this class to test on a kiosk window. | 65 // Use this class to test on a kiosk window. |
| 58 class PermissionBubbleKioskBrowserTest : public PermissionBubbleBrowserTest { | 66 class PermissionBubbleKioskBrowserTest : public PermissionBubbleBrowserTest { |
| 59 public: | 67 public: |
| 60 PermissionBubbleKioskBrowserTest(); | 68 PermissionBubbleKioskBrowserTest(); |
| 61 ~PermissionBubbleKioskBrowserTest() override; | 69 ~PermissionBubbleKioskBrowserTest() override; |
| 62 | 70 |
| 63 void SetUpCommandLine(base::CommandLine* command_line) override; | 71 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 64 | 72 |
| 65 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleKioskBrowserTest); | 73 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleKioskBrowserTest); |
| 66 }; | 74 }; |
| 67 | 75 |
| 68 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTI L_H_ | 76 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_BROWSER_TEST_UTI L_H_ |
| OLD | NEW |