OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gfx/layout_util.h" |
| 6 |
| 7 #import <Cocoa/Cocoa.h> |
| 8 |
| 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/browser/web_contents_view.h" |
| 11 |
| 12 namespace gfx { |
| 13 |
| 14 void ResizeWebContents(content::WebContents* web_contents, |
| 15 const gfx::Size& new_size) { |
| 16 gfx::NativeView view = web_contents->GetView()->GetNativeView(); |
| 17 NSRect old_wcv_frame = [view frame]; |
| 18 CGFloat new_x = old_wcv_frame.origin.x; |
| 19 CGFloat new_y = |
| 20 old_wcv_frame.origin.y + (old_wcv_frame.size.height - new_size.height()); |
| 21 NSRect new_wcv_frame = |
| 22 NSMakeRect(new_x, new_y, new_size.width(), new_size.height()); |
| 23 [view setFrame:new_wcv_frame]; |
| 24 } |
| 25 |
| 26 } // namespace gfx |
OLD | NEW |