Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: apps/ui/web_contents_sizer.mm

Issue 244643008: Merge 262276 "Remove references to WebContentsView::SizeContents..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1916/src/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « apps/ui/web_contents_sizer.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "apps/ui/web_contents_sizer.h" 5 #include "apps/ui/web_contents_sizer.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_view.h" 10 #include "content/public/browser/web_contents_view.h"
11 11
12 namespace apps { 12 namespace apps {
13 13
14 void ResizeWebContents(content::WebContents* web_contents, 14 void ResizeWebContents(content::WebContents* web_contents,
15 const gfx::Size& new_size) { 15 const gfx::Size& new_size) {
16 NSView* view = web_contents->GetView()->GetNativeView(); 16 NSView* view = web_contents->GetView()->GetNativeView();
17 NSRect old_wcv_frame = [view frame]; 17 NSRect old_wcv_frame = [view frame];
18 CGFloat new_x = old_wcv_frame.origin.x; 18 CGFloat new_x = old_wcv_frame.origin.x;
19 CGFloat new_y = 19 CGFloat new_y =
20 old_wcv_frame.origin.y + (old_wcv_frame.size.height - new_size.height()); 20 old_wcv_frame.origin.y + (old_wcv_frame.size.height - new_size.height());
21 NSRect new_wcv_frame = 21 NSRect new_wcv_frame =
22 NSMakeRect(new_x, new_y, new_size.width(), new_size.height()); 22 NSMakeRect(new_x, new_y, new_size.width(), new_size.height());
23 [view setFrame:new_wcv_frame]; 23 [view setFrame:new_wcv_frame];
24 } 24 }
25 25
26 } // namespace apps 26 } // namespace apps
OLDNEW
« no previous file with comments | « apps/ui/web_contents_sizer.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698