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

Side by Side Diff: chrome/browser/ui/test/permission_bubble_browser_test_util.h

Issue 986333006: Center permission bubble if location bar is hidden in MacOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply Feedback Created 5 years, 8 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
groby-ooo-7-16 2015/04/10 20:58:56 File belongs into c/b/ui/website_settings, since i
hcarmona 2015/04/10 22:28:05 Done.
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_TEST_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_
6 #define CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_
7
8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/browser/ui/website_settings/permission_bubble_view.h"
10
11 namespace base {
12 class CommandLine;
13 }
14 class PermissionBubbleRequest;
15 class Browser;
16
17 class TestPermissionBubbleViewDelegate : public PermissionBubbleView::Delegate {
18 public:
19 TestPermissionBubbleViewDelegate();
groby-ooo-7-16 2015/04/10 20:58:55 empty ctor here. (See below)
hcarmona 2015/04/10 22:28:05 Acknowledged.
20
21 void ToggleAccept(int, bool) override {}
22 void Accept() override {}
23 void Deny() override {}
24 void Closing() override {}
25 void SetView(PermissionBubbleView*) override {}
26
27 private:
28 DISALLOW_COPY_AND_ASSIGN(TestPermissionBubbleViewDelegate);
29 };
30
31 // Use this class to test on a default window.
32 // Inherit from ExtensionBrowserTest instead of InProcessBrowserTest because
33 // testing app mode requires extensions.
34 class PermissionBubbleBrowsertest : public ExtensionBrowserTest {
35 public:
36 PermissionBubbleBrowsertest();
groby-ooo-7-16 2015/04/10 20:58:56 Just define an empty ctor inline - you're not doin
hcarmona 2015/04/10 22:28:05 Can't do that b/c these classes are considered com
groby-ooo-7-16 2015/04/10 23:00:33 Sigh. You're right - I forgot that any templated m
37 ~PermissionBubbleBrowsertest() override;
groby-ooo-7-16 2015/04/10 20:58:56 Same goes for dtor
hcarmona 2015/04/10 22:28:05 Acknowledged.
38
39 void SetUpOnMainThread() override;
40
41 std::vector<PermissionBubbleRequest*> requests() { return requests_.get(); }
42 std::vector<bool> accept_states() { return accept_states_; }
43 PermissionBubbleView::Delegate* test_delegate() { return &test_delegate_; }
44
45 private:
46 TestPermissionBubbleViewDelegate test_delegate_;
47 ScopedVector<PermissionBubbleRequest> requests_;
48 std::vector<bool> accept_states_;
49 };
50
51 // Use this class to test on an app window.
52 class PermissionBubbleAppBrowsertest : public PermissionBubbleBrowsertest {
53 public:
54 PermissionBubbleAppBrowsertest();
55 ~PermissionBubbleAppBrowsertest() override;
56
57 void SetUpOnMainThread() override;
58
59 Browser* app_browser() { return app_browser_; }
60
61 private:
62 Browser* app_browser_;
63
64 Browser* OpenExtensionAppWindow(const extensions::Extension* extension);
65 };
66
67 // Use this class to test on a kiosk window.
68 class PermissionBubbleKioskBrowsertest : public PermissionBubbleBrowsertest {
69 public:
70 PermissionBubbleKioskBrowsertest();
groby-ooo-7-16 2015/04/10 20:58:55 empty ctor here.
hcarmona 2015/04/10 22:28:05 Acknowledged.
71 ~PermissionBubbleKioskBrowsertest() override;
72
73 void SetUpCommandLine(base::CommandLine* command_line) override;
74 };
75
76 #endif // CHROME_BROWSER_UI_TEST_PERMISSION_BUBBLE_BROWSER_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698