| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void TestWebViewDelegate::closeWidgetSoon() { | 96 void TestWebViewDelegate::closeWidgetSoon() { |
| 97 if (this == shell_->delegate()) { | 97 if (this == shell_->delegate()) { |
| 98 NSWindow *win = shell_->mainWnd(); | 98 NSWindow *win = shell_->mainWnd(); |
| 99 [win performSelector:@selector(performClose:) withObject:nil afterDelay:0]; | 99 [win performSelector:@selector(performClose:) withObject:nil afterDelay:0]; |
| 100 } else if (this == shell_->popup_delegate()) { | 100 } else if (this == shell_->popup_delegate()) { |
| 101 shell_->ClosePopup(); | 101 shell_->ClosePopup(); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 void TestWebViewDelegate::didChangeCursor(const WebCursorInfo& cursor_info) { | 105 void TestWebViewDelegate::didChangeCursor(const WebCursorInfo& cursor_info) { |
| 106 NSCursor* ns_cursor = WebCursor(cursor_info).GetCursor(); | 106 NSCursor* ns_cursor = WebCursor(cursor_info).GetNativeCursor(); |
| 107 [ns_cursor set]; | 107 [ns_cursor set]; |
| 108 } | 108 } |
| 109 | 109 |
| 110 WebRect TestWebViewDelegate::windowRect() { | 110 WebRect TestWebViewDelegate::windowRect() { |
| 111 if (WebWidgetHost* host = GetWidgetHost()) { | 111 if (WebWidgetHost* host = GetWidgetHost()) { |
| 112 NSView *view = host->view_handle(); | 112 NSView *view = host->view_handle(); |
| 113 NSRect rect = [view frame]; | 113 NSRect rect = [view frame]; |
| 114 return gfx::Rect(NSRectToCGRect(rect)); | 114 return gfx::Rect(NSRectToCGRect(rect)); |
| 115 } | 115 } |
| 116 return WebRect(); | 116 return WebRect(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 void TestWebViewDelegate::SetPageTitle(const string16& title) { | 219 void TestWebViewDelegate::SetPageTitle(const string16& title) { |
| 220 [[shell_->webViewHost()->view_handle() window] | 220 [[shell_->webViewHost()->view_handle() window] |
| 221 setTitle:[NSString stringWithUTF8String:UTF16ToUTF8(title).c_str()]]; | 221 setTitle:[NSString stringWithUTF8String:UTF16ToUTF8(title).c_str()]]; |
| 222 } | 222 } |
| 223 | 223 |
| 224 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 224 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
| 225 const char* frameURL = url.spec().c_str(); | 225 const char* frameURL = url.spec().c_str(); |
| 226 NSString *address = [NSString stringWithUTF8String:frameURL]; | 226 NSString *address = [NSString stringWithUTF8String:frameURL]; |
| 227 [shell_->editWnd() setStringValue:address]; | 227 [shell_->editWnd() setStringValue:address]; |
| 228 } | 228 } |
| OLD | NEW |