Chromium Code Reviews| Index: chrome/browser/ui/views/apps/native_frame_view_mac.mm |
| diff --git a/chrome/browser/ui/views/apps/native_frame_view_mac.mm b/chrome/browser/ui/views/apps/native_frame_view_mac.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..57dd912f375010b920c70ced36db1ff17b228797 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/apps/native_frame_view_mac.mm |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/views/apps/native_frame_view_mac.h" |
| + |
| +#import <Cocoa/Cocoa.h> |
| + |
| +#import "ui/gfx/mac/coordinate_conversion.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +// static |
| +const char NativeFrameViewMac::kViewClassName[] = "NativeFrameViewMac"; |
| + |
| +NativeFrameViewMac::NativeFrameViewMac(views::Widget* frame) |
| + : views::NativeFrameView(frame) { |
| +} |
| + |
| +NativeFrameViewMac::~NativeFrameViewMac() { |
| +} |
| + |
| +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.
|
| + const gfx::Rect& client_bounds) const { |
| + NSWindow* ns_window = GetWidget()->GetNativeWindow(); |
| + gfx::Rect window_bounds = gfx::ScreenRectFromNSRect([ns_window |
| + frameRectForContentRect:gfx::ScreenRectToNSRect(client_bounds)]); |
| + // Enforce minimum size (1, 1) in case that |client_bounds| is passed with |
| + // empty size. |
| + if (window_bounds.IsEmpty()) |
| + window_bounds.set_size(gfx::Size(1, 1)); |
| + return window_bounds; |
| +} |