| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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/webview_host.h" | 7 #include "webkit/tools/test_shell/webview_host.h" |
| 8 #include "webkit/tools/test_shell/mac/test_shell_webview.h" | 8 #include "webkit/tools/test_shell/mac/test_shell_webview.h" |
| 9 | 9 |
| 10 #include "base/gfx/platform_canvas.h" | 10 #include "base/gfx/platform_canvas.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // TODO(awalker): replace explicit view layout with a little nib file | 27 // TODO(awalker): replace explicit view layout with a little nib file |
| 28 // and use that for view geometry. | 28 // and use that for view geometry. |
| 29 content_rect.size.height -= 32; | 29 content_rect.size.height -= 32; |
| 30 host->view_ = [[TestShellWebView alloc] initWithFrame:content_rect]; | 30 host->view_ = [[TestShellWebView alloc] initWithFrame:content_rect]; |
| 31 // make the height and width track the window size. | 31 // make the height and width track the window size. |
| 32 [host->view_ setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; | 32 [host->view_ setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; |
| 33 [parent_view addSubview:host->view_]; | 33 [parent_view addSubview:host->view_]; |
| 34 [host->view_ release]; | 34 [host->view_ release]; |
| 35 | 35 |
| 36 host->webwidget_ = WebView::Create(delegate, prefs); | 36 host->webwidget_ = WebView::Create(delegate, prefs); |
| 37 host->webwidget_->Resize(WebSize(content_rect.size.width, | 37 host->webwidget_->resize(WebSize(content_rect.size.width, |
| 38 content_rect.size.height)); | 38 content_rect.size.height)); |
| 39 | 39 |
| 40 return host; | 40 return host; |
| 41 } | 41 } |
| 42 | 42 |
| 43 WebView* WebViewHost::webview() const { | 43 WebView* WebViewHost::webview() const { |
| 44 return static_cast<WebView*>(webwidget_); | 44 return static_cast<WebView*>(webwidget_); |
| 45 } | 45 } |
| OLD | NEW |