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 #include "webkit/tools/test_shell/test_webview_delegate.h" | 5 #include "webkit/tools/test_shell/test_webview_delegate.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return gfx::Rect(NSRectToCGRect(resize_rect)); | 220 return gfx::Rect(NSRectToCGRect(resize_rect)); |
221 } | 221 } |
222 | 222 |
223 void TestWebViewDelegate::runModal() { | 223 void TestWebViewDelegate::runModal() { |
224 NOTIMPLEMENTED(); | 224 NOTIMPLEMENTED(); |
225 } | 225 } |
226 | 226 |
227 // WebPluginPageDelegate ------------------------------------------------------ | 227 // WebPluginPageDelegate ------------------------------------------------------ |
228 | 228 |
229 webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( | 229 webkit::npapi::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( |
230 const FilePath& path, | 230 const base::FilePath& path, |
231 const std::string& mime_type) { | 231 const std::string& mime_type) { |
232 WebWidgetHost *host = GetWidgetHost(); | 232 WebWidgetHost *host = GetWidgetHost(); |
233 if (!host) | 233 if (!host) |
234 return NULL; | 234 return NULL; |
235 | 235 |
236 WebPluginDelegateImpl* delegate = | 236 WebPluginDelegateImpl* delegate = |
237 WebPluginDelegateImpl::Create(path, mime_type); | 237 WebPluginDelegateImpl::Create(path, mime_type); |
238 if (delegate) | 238 if (delegate) |
239 delegate->SetNoBufferContext(); | 239 delegate->SetNoBufferContext(); |
240 return delegate; | 240 return delegate; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 void TestWebViewDelegate::SetPageTitle(const string16& title) { | 275 void TestWebViewDelegate::SetPageTitle(const string16& title) { |
276 [[shell_->webViewHost()->view_handle() window] | 276 [[shell_->webViewHost()->view_handle() window] |
277 setTitle:[NSString stringWithUTF8String:UTF16ToUTF8(title).c_str()]]; | 277 setTitle:[NSString stringWithUTF8String:UTF16ToUTF8(title).c_str()]]; |
278 } | 278 } |
279 | 279 |
280 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 280 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
281 const char* frameURL = url.spec().c_str(); | 281 const char* frameURL = url.spec().c_str(); |
282 NSString *address = [NSString stringWithUTF8String:frameURL]; | 282 NSString *address = [NSString stringWithUTF8String:frameURL]; |
283 [shell_->editWnd() setStringValue:address]; | 283 [shell_->editWnd() setStringValue:address]; |
284 } | 284 } |
OLD | NEW |