OLD | NEW |
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 // 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 shell_->set_is_modal(true); | 126 shell_->set_is_modal(true); |
127 MessageLoop::current()->Run(); | 127 MessageLoop::current()->Run(); |
128 | 128 |
129 for (WindowList::const_iterator i = wl->begin(); i != wl->end(); ++i) | 129 for (WindowList::const_iterator i = wl->begin(); i != wl->end(); ++i) |
130 EnableWindow(*i, TRUE); | 130 EnableWindow(*i, TRUE); |
131 } | 131 } |
132 | 132 |
133 // WebPluginPageDelegate ------------------------------------------------------ | 133 // WebPluginPageDelegate ------------------------------------------------------ |
134 | 134 |
135 webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( | 135 webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( |
136 const FilePath& path, | 136 const base::FilePath& path, |
137 const std::string& mime_type) { | 137 const std::string& mime_type) { |
138 HWND hwnd = shell_->webViewHost()->view_handle(); | 138 HWND hwnd = shell_->webViewHost()->view_handle(); |
139 if (!hwnd) | 139 if (!hwnd) |
140 return NULL; | 140 return NULL; |
141 | 141 |
142 return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type); | 142 return webkit::npapi::WebPluginDelegateImpl::Create(path, mime_type); |
143 } | 143 } |
144 | 144 |
145 void TestWebViewDelegate::CreatedPluginWindow( | 145 void TestWebViewDelegate::CreatedPluginWindow( |
146 gfx::PluginWindowHandle handle) { | 146 gfx::PluginWindowHandle handle) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 void TestWebViewDelegate::SetPageTitle(const string16& title) { | 199 void TestWebViewDelegate::SetPageTitle(const string16& title) { |
200 // The Windows test shell, pre-refactoring, ignored this. *shrug* | 200 // The Windows test shell, pre-refactoring, ignored this. *shrug* |
201 } | 201 } |
202 | 202 |
203 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 203 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
204 string16 url_string = UTF8ToUTF16(url.spec()); | 204 string16 url_string = UTF8ToUTF16(url.spec()); |
205 SendMessage(shell_->editWnd(), WM_SETTEXT, 0, | 205 SendMessage(shell_->editWnd(), WM_SETTEXT, 0, |
206 reinterpret_cast<LPARAM>(url_string.c_str())); | 206 reinterpret_cast<LPARAM>(url_string.c_str())); |
207 } | 207 } |
OLD | NEW |