| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_PROMPT_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_PROMPT_H_ |
| 7 |
| 8 #include "chrome/browser/ui/website_settings/permission_prompt.h" |
| 9 |
| 10 class MockPermissionPromptFactory; |
| 11 class PermissionRequestManager; |
| 12 |
| 13 // Provides a skeleton class for unit and browser testing when trying to test |
| 14 // the request manager logic. Should not be used for anything that requires |
| 15 // actual UI. |
| 16 // Use the MockPermissionPromptFactory to create this. |
| 17 class MockPermissionPrompt : public PermissionPrompt { |
| 18 public: |
| 19 ~MockPermissionPrompt() override; |
| 20 |
| 21 // PermissionPrompt: |
| 22 void SetDelegate(Delegate* delegate) override {} |
| 23 void Show(const std::vector<PermissionRequest*>& requests, |
| 24 const std::vector<bool>& accept_state) override; |
| 25 bool CanAcceptRequestUpdate() override; |
| 26 void Hide() override; |
| 27 bool IsVisible() override; |
| 28 void UpdateAnchorPosition() override; |
| 29 gfx::NativeWindow GetNativeWindow() override; |
| 30 |
| 31 private: |
| 32 friend class MockPermissionPromptFactory; |
| 33 |
| 34 MockPermissionPrompt(MockPermissionPromptFactory* factory, |
| 35 PermissionRequestManager* manager); |
| 36 |
| 37 MockPermissionPromptFactory* factory_; |
| 38 PermissionRequestManager* manager_; |
| 39 bool can_update_ui_; |
| 40 bool is_visible_; |
| 41 }; |
| 42 |
| 43 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_PROMPT_H_ |
| OLD | NEW |