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 #import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 | 105 |
106 // Padding between the window frame and content for the internal page bubble. | 106 // Padding between the window frame and content for the internal page bubble. |
107 const CGFloat kInternalPageFramePadding = 10; | 107 const CGFloat kInternalPageFramePadding = 10; |
108 | 108 |
109 // Spacing between the image and text for internal pages. | 109 // Spacing between the image and text for internal pages. |
110 const CGFloat kInternalPageImageSpacing = 10; | 110 const CGFloat kInternalPageImageSpacing = 10; |
111 | 111 |
112 // ----------------------------------------------------------------------------- | 112 // ----------------------------------------------------------------------------- |
113 | 113 |
114 // NOTE: This assumes that there will never be more than one page info | 114 // NOTE: This assumes that there will never be more than one page info |
115 // popup shown, and that the one that is shown is associated with the current | 115 // popup shown, and that the one that is shown is associated with the current |
msw
2017/04/05 17:05:52
nit: s/popup/bubble/ here (and elsewhere...)
| |
116 // window. This matches the behaviour in views: see PageInfoPopupView. | 116 // window. This matches the behaviour in views: see PageInfoBubbleView. |
117 bool g_is_popup_showing = false; | 117 bool g_is_popup_showing = false; |
118 | 118 |
119 // Takes in the parent window, which should be a BrowserWindow, and gets the | 119 // Takes in the parent window, which should be a BrowserWindow, and gets the |
120 // proper anchor point for the bubble. The returned point is in screen | 120 // proper anchor point for the bubble. The returned point is in screen |
121 // coordinates. | 121 // coordinates. |
122 NSPoint AnchorPointForWindow(NSWindow* parent) { | 122 NSPoint AnchorPointForWindow(NSWindow* parent) { |
123 BrowserWindowController* controller = [parent windowController]; | 123 BrowserWindowController* controller = [parent windowController]; |
124 NSPoint origin = NSZeroPoint; | 124 NSPoint origin = NSZeroPoint; |
125 if ([controller isKindOfClass:[BrowserWindowController class]]) { | 125 if ([controller isKindOfClass:[BrowserWindowController class]]) { |
126 LocationBarViewMac* location_bar = [controller locationBarBridge]; | 126 LocationBarViewMac* location_bar = [controller locationBarBridge]; |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1194 void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) { | 1194 void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) { |
1195 [bubble_controller_ setCookieInfo:cookie_info_list]; | 1195 [bubble_controller_ setCookieInfo:cookie_info_list]; |
1196 } | 1196 } |
1197 | 1197 |
1198 void PageInfoUIBridge::SetPermissionInfo( | 1198 void PageInfoUIBridge::SetPermissionInfo( |
1199 const PermissionInfoList& permission_info_list, | 1199 const PermissionInfoList& permission_info_list, |
1200 ChosenObjectInfoList chosen_object_info_list) { | 1200 ChosenObjectInfoList chosen_object_info_list) { |
1201 [bubble_controller_ setPermissionInfo:permission_info_list | 1201 [bubble_controller_ setPermissionInfo:permission_info_list |
1202 andChosenObjects:std::move(chosen_object_info_list)]; | 1202 andChosenObjects:std::move(chosen_object_info_list)]; |
1203 } | 1203 } |
OLD | NEW |