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