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/website_settings/permission_bubble_controller.h
" | 5 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
10 #include "base/mac/foundation_util.h" | |
11 #include "base/mac/mac_util.h" | |
12 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
13 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
14 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
16 #import "chrome/browser/ui/chrome_style.h" | 14 #import "chrome/browser/ui/chrome_style.h" |
17 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
18 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 16 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
19 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" | 17 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" |
20 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 18 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
21 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 19 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 588 |
591 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { | 589 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { |
592 NSRect frameA = [viewA frame]; | 590 NSRect frameA = [viewA frame]; |
593 NSRect frameB = [viewB frame]; | 591 NSRect frameB = [viewB frame]; |
594 frameA.origin.y = | 592 frameA.origin.y = |
595 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); | 593 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); |
596 [viewA setFrameOrigin:frameA.origin]; | 594 [viewA setFrameOrigin:frameA.origin]; |
597 } | 595 } |
598 | 596 |
599 @end // implementation PermissionBubbleController | 597 @end // implementation PermissionBubbleController |
OLD | NEW |