OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ui/views/apps/native_frame_view_mac.h" | |
6 | |
7 #import <Cocoa/Cocoa.h> | |
8 | |
9 #import "ui/gfx/mac/coordinate_conversion.h" | |
10 #include "ui/views/widget/widget.h" | |
11 | |
12 // static | |
13 const char NativeFrameViewMac::kViewClassName[] = "NativeFrameViewMac"; | |
14 | |
15 NativeFrameViewMac::NativeFrameViewMac(views::Widget* frame) | |
16 : views::NativeFrameView(frame) { | |
17 } | |
18 | |
19 NativeFrameViewMac::~NativeFrameViewMac() { | |
20 } | |
21 | |
22 gfx::Rect NativeFrameViewMac::GetWindowBoundsForClientBounds( | |
tapted
2015/03/30 06:33:37
I'm not sure exactly what this is solving
the rig
jackhou1
2015/03/31 00:50:42
AppWindow needs something to provide the right ins
tapted
2015/03/31 01:06:30
OK I think we should call it NativeAppWindowFrameV
jackhou1
2015/03/31 01:59:47
Done.
| |
23 const gfx::Rect& client_bounds) const { | |
24 NSWindow* ns_window = GetWidget()->GetNativeWindow(); | |
25 gfx::Rect window_bounds = gfx::ScreenRectFromNSRect([ns_window | |
26 frameRectForContentRect:gfx::ScreenRectToNSRect(client_bounds)]); | |
27 // Enforce minimum size (1, 1) in case that |client_bounds| is passed with | |
28 // empty size. | |
29 if (window_bounds.IsEmpty()) | |
30 window_bounds.set_size(gfx::Size(1, 1)); | |
31 return window_bounds; | |
32 } | |
OLD | NEW |