OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 // This file contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
8 | 8 |
9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 TestWebViewDelegate::~TestWebViewDelegate() { | 41 TestWebViewDelegate::~TestWebViewDelegate() { |
42 RevokeDragDrop(shell_->webViewWnd()); | 42 RevokeDragDrop(shell_->webViewWnd()); |
43 } | 43 } |
44 | 44 |
45 WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( | 45 WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( |
46 WebView* webview, | 46 WebView* webview, |
47 const GURL& url, | 47 const GURL& url, |
48 const std::string& mime_type, | 48 const std::string& mime_type, |
49 const std::string& clsid, | 49 const std::string& clsid, |
50 std::string* actual_mime_type) { | 50 std::string* actual_mime_type) { |
51 HWND hwnd = gfx::NativeViewFromId(GetContainingView(webview)); | 51 HWND hwnd = shell_->webViewHost()->view_handle(); |
52 if (!hwnd) | 52 if (!hwnd) |
53 return NULL; | 53 return NULL; |
54 | 54 |
55 bool allow_wildcard = true; | 55 bool allow_wildcard = true; |
56 WebPluginInfo info; | 56 WebPluginInfo info; |
57 if (!NPAPI::PluginList::Singleton()->GetPluginInfo(url, mime_type, clsid, | 57 if (!NPAPI::PluginList::Singleton()->GetPluginInfo(url, mime_type, clsid, |
58 allow_wildcard, &info, | 58 allow_wildcard, &info, |
59 actual_mime_type)) | 59 actual_mime_type)) |
60 return NULL; | 60 return NULL; |
61 | 61 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { | 191 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { |
192 // The Windows test shell, pre-refactoring, ignored this. *shrug* | 192 // The Windows test shell, pre-refactoring, ignored this. *shrug* |
193 } | 193 } |
194 | 194 |
195 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 195 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
196 std::wstring url_string = UTF8ToWide(url.spec()); | 196 std::wstring url_string = UTF8ToWide(url.spec()); |
197 SendMessage(shell_->editWnd(), WM_SETTEXT, 0, | 197 SendMessage(shell_->editWnd(), WM_SETTEXT, 0, |
198 reinterpret_cast<LPARAM>(url_string.c_str())); | 198 reinterpret_cast<LPARAM>(url_string.c_str())); |
199 } | 199 } |
OLD | NEW |