OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 NSString *text = | 209 NSString *text = |
210 [NSString stringWithUTF8String:WideToUTF8(message).c_str()]; | 210 [NSString stringWithUTF8String:WideToUTF8(message).c_str()]; |
211 NSAlert *alert = [NSAlert alertWithMessageText:@"JavaScript Alert" | 211 NSAlert *alert = [NSAlert alertWithMessageText:@"JavaScript Alert" |
212 defaultButton:@"OK" | 212 defaultButton:@"OK" |
213 alternateButton:nil | 213 alternateButton:nil |
214 otherButton:nil | 214 otherButton:nil |
215 informativeTextWithFormat:text]; | 215 informativeTextWithFormat:text]; |
216 [alert runModal]; | 216 [alert runModal]; |
217 } | 217 } |
218 | 218 |
219 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { | 219 void TestWebViewDelegate::SetPageTitle(const string16& title) { |
220 [[shell_->webViewHost()->view_handle() window] | 220 [[shell_->webViewHost()->view_handle() window] |
221 setTitle:[NSString stringWithUTF8String:WideToUTF8(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 |