| 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(
|
| + 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;
|
| +}
|
|
|