Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: chrome/browser/ui/website_settings/mock_permission_bubble_factory.h

Issue 2081103002: Rename PermissionBubbleManager to PermissionRequestManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_FACTORY_H_ 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_ 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "chrome/browser/permissions/permission_request_manager.h"
12 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
13 12
14 class Browser; 13 class Browser;
15 class PermissionBubbleView; 14 class PermissionBubbleView;
16 class MockPermissionBubbleView; 15 class MockPermissionBubbleView;
17 16
18 // Provides a skeleton class for both unit and browser testing when trying to 17 // Provides a skeleton class for both unit and browser testing when trying to
19 // test the bubble manager logic. Should not be used for anything that requires 18 // test the bubble manager logic. Should not be used for anything that requires
20 // actual UI. 19 // actual UI.
21 // See example usage in 20 // See example usage in
22 // chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc 21 // chrome/browser/ui/website_settings/permission_request_manager_unittest.cc
Lei Zhang 2016/07/13 02:04:24 Ah ha! A mistake! I finally feel useful. chrome/b
tsergeant 2016/07/13 04:20:53 Ah, nice pickup. Done.
23 class MockPermissionBubbleFactory { 22 class MockPermissionBubbleFactory {
24 public: 23 public:
25 explicit MockPermissionBubbleFactory(PermissionBubbleManager* manager); 24 explicit MockPermissionBubbleFactory(PermissionRequestManager* manager);
26 ~MockPermissionBubbleFactory(); 25 ~MockPermissionBubbleFactory();
27 26
28 // Create method called by the PBM to show a bubble. 27 // Create method called by the PBM to show a bubble.
29 std::unique_ptr<PermissionBubbleView> Create(Browser* browser); 28 std::unique_ptr<PermissionBubbleView> Create(Browser* browser);
30 29
31 void SetCanUpdateUi(bool can_update_ui); 30 void SetCanUpdateUi(bool can_update_ui);
32 31
33 void ResetCounts(); 32 void ResetCounts();
34 33
35 void DocumentOnLoadCompletedInMainFrame(); 34 void DocumentOnLoadCompletedInMainFrame();
36 35
37 void set_response_type(PermissionBubbleManager::AutoResponseType type) { 36 void set_response_type(PermissionRequestManager::AutoResponseType type) {
38 response_type_ = type; 37 response_type_ = type;
39 } 38 }
40 39
41 // If the current view is visible. 40 // If the current view is visible.
42 bool is_visible(); 41 bool is_visible();
43 // Number of times |Show| was called on any bubble. 42 // Number of times |Show| was called on any bubble.
44 int show_count() { return show_count_; } 43 int show_count() { return show_count_; }
45 // Number of requests seen by the last |Show|. 44 // Number of requests seen by the last |Show|.
46 int request_count() { return requests_count_; } 45 int request_count() { return requests_count_; }
47 // Number of requests seen. 46 // Number of requests seen.
(...skipping 10 matching lines...) Expand all
58 57
59 void UpdateResponseType(); 58 void UpdateResponseType();
60 void ShowView(MockPermissionBubbleView* view); 59 void ShowView(MockPermissionBubbleView* view);
61 void HideView(MockPermissionBubbleView* view); 60 void HideView(MockPermissionBubbleView* view);
62 61
63 bool can_update_ui_; 62 bool can_update_ui_;
64 int show_count_; 63 int show_count_;
65 int requests_count_; 64 int requests_count_;
66 int total_requests_count_; 65 int total_requests_count_;
67 std::vector<MockPermissionBubbleView*> views_; 66 std::vector<MockPermissionBubbleView*> views_;
68 PermissionBubbleManager::AutoResponseType response_type_; 67 PermissionRequestManager::AutoResponseType response_type_;
69 68
70 base::Closure show_bubble_quit_closure_; 69 base::Closure show_bubble_quit_closure_;
71 70
72 // The bubble manager that will be associated with this factory. 71 // The bubble manager that will be associated with this factory.
73 PermissionBubbleManager* manager_; 72 PermissionRequestManager* manager_;
74 73
75 DISALLOW_COPY_AND_ASSIGN(MockPermissionBubbleFactory); 74 DISALLOW_COPY_AND_ASSIGN(MockPermissionBubbleFactory);
76 }; 75 };
77 76
78 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_ 77 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698