OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COCOA_PERMISSION_BUBBLE_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | |
9 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
10 #include "base/macros.h" | 9 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
12 #include "chrome/browser/ui/cocoa/info_bubble_view.h" | |
13 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" | 11 #include "chrome/browser/ui/website_settings/permission_bubble_view.h" |
14 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
15 | 13 |
16 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
17 @class PermissionBubbleController; | 15 @class PermissionBubbleController; |
18 #else | 16 #else |
19 class PermissionBubbleController; | 17 class PermissionBubbleController; |
20 #endif | 18 #endif |
21 | 19 |
22 class PermissionBubbleCocoa : public PermissionBubbleView { | 20 class PermissionBubbleCocoa : public PermissionBubbleView { |
(...skipping 15 matching lines...) Expand all Loading... |
38 // Returns the point, in screen coordinates, to which the bubble's arrow | 36 // Returns the point, in screen coordinates, to which the bubble's arrow |
39 // should point. | 37 // should point. |
40 NSPoint GetAnchorPoint(); | 38 NSPoint GetAnchorPoint(); |
41 | 39 |
42 // Returns the NSWindow containing the bubble. | 40 // Returns the NSWindow containing the bubble. |
43 NSWindow* window(); | 41 NSWindow* window(); |
44 | 42 |
45 // Change the parent window to be used the next time the bubble is shown. | 43 // Change the parent window to be used the next time the bubble is shown. |
46 void SwitchParentWindow(NSWindow* parent); | 44 void SwitchParentWindow(NSWindow* parent); |
47 | 45 |
48 info_bubble::BubbleArrowLocation GetArrowLocation(); | 46 private: |
49 | |
50 private: | |
51 FRIEND_TEST_ALL_PREFIXES(PermissionBubbleBrowserTest, | |
52 HasLocationBarByDefault); | |
53 FRIEND_TEST_ALL_PREFIXES(PermissionBubbleBrowserTest, | |
54 FullscreenHasLocationBar); | |
55 FRIEND_TEST_ALL_PREFIXES(PermissionBubbleAppBrowserTest, AppHasNoLocationBar); | |
56 FRIEND_TEST_ALL_PREFIXES(PermissionBubbleKioskBrowserTest, | |
57 KioskHasNoLocationBar); | |
58 | |
59 NSWindow* parent_window_; // Weak. | 47 NSWindow* parent_window_; // Weak. |
60 Delegate* delegate_; // Weak. | 48 Delegate* delegate_; // Weak. |
61 | 49 |
62 // Cocoa-side UI controller for the bubble. Weak, as it will close itself. | 50 // Cocoa-side UI controller for the bubble. Weak, as it will close itself. |
63 PermissionBubbleController* bubbleController_; | 51 PermissionBubbleController* bubbleController_; |
64 virtual bool HasLocationBar(); | |
65 | 52 |
66 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleCocoa); | 53 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleCocoa); |
67 }; | 54 }; |
68 | 55 |
69 #endif // CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_ | 56 #endif // CHROME_BROWSER_UI_COCOA_PERMISSION_BUBBLE_COCOA_H_ |
OLD | NEW |