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/rect.h" | 10 #include "base/gfx/rect.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // and use that for view geometry. | 30 // and use that for view geometry. |
31 content_rect.size.height -= 32; | 31 content_rect.size.height -= 32; |
32 host->view_ = [[TestShellWebView alloc] initWithFrame:content_rect]; | 32 host->view_ = [[TestShellWebView alloc] initWithFrame:content_rect]; |
33 // make the height and width track the window size. | 33 // make the height and width track the window size. |
34 [host->view_ setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; | 34 [host->view_ setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; |
35 [parent_view addSubview:host->view_]; | 35 [parent_view addSubview:host->view_]; |
36 [host->view_ release]; | 36 [host->view_ release]; |
37 | 37 |
38 host->webwidget_ = WebView::Create(delegate, delegate); | 38 host->webwidget_ = WebView::Create(delegate, delegate); |
39 prefs.Apply(host->webview()); | 39 prefs.Apply(host->webview()); |
40 host->webview()->InitializeMainFrame(); | 40 host->webview()->InitializeMainFrame(delegate); |
41 host->webwidget_->resize(WebSize(content_rect.size.width, | 41 host->webwidget_->resize(WebSize(content_rect.size.width, |
42 content_rect.size.height)); | 42 content_rect.size.height)); |
43 | 43 |
44 return host; | 44 return host; |
45 } | 45 } |
46 | 46 |
47 WebView* WebViewHost::webview() const { | 47 WebView* WebViewHost::webview() const { |
48 return static_cast<WebView*>(webwidget_); | 48 return static_cast<WebView*>(webwidget_); |
49 } | 49 } |
OLD | NEW |