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

Side by Side Diff: webkit/tools/test_shell/webwidget_host_mac.mm

Issue 10545050: mac: Use NSWidth() and friends in a few more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 8 years, 6 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 | « webkit/tools/test_shell/webview_host_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "webkit/tools/test_shell/webwidget_host.h" 7 #include "webkit/tools/test_shell/webwidget_host.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "skia/ext/platform_canvas.h" 10 #include "skia/ext/platform_canvas.h"
(...skipping 26 matching lines...) Expand all
37 37
38 NSRect content_rect = [parent_view frame]; 38 NSRect content_rect = [parent_view frame];
39 content_rect.origin.y += 64; 39 content_rect.origin.y += 64;
40 content_rect.size.height -= 64; 40 content_rect.size.height -= 64;
41 host->view_ = [[NSView alloc] initWithFrame:content_rect]; 41 host->view_ = [[NSView alloc] initWithFrame:content_rect];
42 [parent_view addSubview:host->view_]; 42 [parent_view addSubview:host->view_];
43 43
44 // ui::SetWindowUserData(host->hwnd_, host); 44 // ui::SetWindowUserData(host->hwnd_, host);
45 45
46 host->webwidget_ = WebPopupMenu::create(client); 46 host->webwidget_ = WebPopupMenu::create(client);
47 host->webwidget_->resize(WebSize(content_rect.size.width, 47 host->webwidget_->resize(WebSize(NSWidth(content_rect),
48 content_rect.size.height)); 48 NSHeight(content_rect)));
49 return host; 49 return host;
50 } 50 }
51 51
52 /*static*/ 52 /*static*/
53 void WebWidgetHost::HandleEvent(NSView* view, NSEvent* event) { 53 void WebWidgetHost::HandleEvent(NSView* view, NSEvent* event) {
54 /* TODO(port): rig up a way to get to the host */ 54 /* TODO(port): rig up a way to get to the host */
55 WebWidgetHost* host = NULL; 55 WebWidgetHost* host = NULL;
56 if (host) { 56 if (host) {
57 switch ([event type]) { 57 switch ([event type]) {
58 case NSLeftMouseDown: 58 case NSLeftMouseDown:
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { 277 void WebWidgetHost::PaintRect(const gfx::Rect& rect) {
278 #ifndef NDEBUG 278 #ifndef NDEBUG
279 DCHECK(!painting_); 279 DCHECK(!painting_);
280 #endif 280 #endif
281 DCHECK(canvas_.get()); 281 DCHECK(canvas_.get());
282 282
283 set_painting(true); 283 set_painting(true);
284 webwidget_->paint(webkit_glue::ToWebCanvas(canvas_.get()), rect); 284 webwidget_->paint(webkit_glue::ToWebCanvas(canvas_.get()), rect);
285 set_painting(false); 285 set_painting(false);
286 } 286 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/webview_host_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698