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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 void TestWebViewDelegate::show(WebNavigationPolicy policy) { | 96 void TestWebViewDelegate::show(WebNavigationPolicy policy) { |
97 if (!popup_menu_info_.get()) | 97 if (!popup_menu_info_.get()) |
98 return; | 98 return; |
99 if (this != shell_->popup_delegate()) | 99 if (this != shell_->popup_delegate()) |
100 return; | 100 return; |
101 // Display a HTML select menu. | 101 // Display a HTML select menu. |
102 | 102 |
103 std::vector<WebMenuItem> items; | 103 std::vector<WebMenuItem> items; |
104 for (size_t i = 0; i < popup_menu_info_->items.size(); ++i) | 104 for (size_t i = 0; i < popup_menu_info_->items.size(); ++i) |
105 items.push_back(popup_menu_info_->items[i]); | 105 items.push_back(WebMenuItem(popup_menu_info_->items[i])); |
106 | 106 |
107 int item_height = popup_menu_info_->itemHeight; | 107 int item_height = popup_menu_info_->itemHeight; |
108 double font_size = popup_menu_info_->itemFontSize; | 108 double font_size = popup_menu_info_->itemFontSize; |
109 int selected_index = popup_menu_info_->selectedIndex; | 109 int selected_index = popup_menu_info_->selectedIndex; |
110 bool right_aligned = popup_menu_info_->rightAligned; | 110 bool right_aligned = popup_menu_info_->rightAligned; |
111 popup_menu_info_.reset(); // No longer needed. | 111 popup_menu_info_.reset(); // No longer needed. |
112 | 112 |
113 const WebRect& bounds = popup_bounds_; | 113 const WebRect& bounds = popup_bounds_; |
114 | 114 |
115 // Set up the menu position. | 115 // Set up the menu position. |
(...skipping 159 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 |