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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 175 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
176 #include "third_party/WebKit/public/web/WebSettings.h" | 176 #include "third_party/WebKit/public/web/WebSettings.h" |
177 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 177 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
178 #include "third_party/WebKit/public/web/WebView.h" | 178 #include "third_party/WebKit/public/web/WebView.h" |
179 #include "third_party/WebKit/public/web/WebWindowFeatures.h" | 179 #include "third_party/WebKit/public/web/WebWindowFeatures.h" |
180 #include "third_party/WebKit/public/web/default/WebRenderTheme.h" | 180 #include "third_party/WebKit/public/web/default/WebRenderTheme.h" |
181 #include "third_party/icu/source/common/unicode/uchar.h" | 181 #include "third_party/icu/source/common/unicode/uchar.h" |
182 #include "third_party/icu/source/common/unicode/uscript.h" | 182 #include "third_party/icu/source/common/unicode/uscript.h" |
183 #include "ui/base/clipboard/clipboard.h" | 183 #include "ui/base/clipboard/clipboard.h" |
184 #include "ui/base/ui_base_switches_util.h" | 184 #include "ui/base/ui_base_switches_util.h" |
| 185 #include "ui/events/keycodes/dom4/keycode_converter.h" |
185 #include "ui/events/latency_info.h" | 186 #include "ui/events/latency_info.h" |
186 #include "ui/gfx/native_widget_types.h" | 187 #include "ui/gfx/native_widget_types.h" |
187 #include "ui/gfx/point.h" | 188 #include "ui/gfx/point.h" |
188 #include "ui/gfx/rect.h" | 189 #include "ui/gfx/rect.h" |
189 #include "ui/gfx/rect_conversions.h" | 190 #include "ui/gfx/rect_conversions.h" |
190 #include "ui/gfx/size_conversions.h" | 191 #include "ui/gfx/size_conversions.h" |
191 #include "v8/include/v8.h" | 192 #include "v8/include/v8.h" |
192 | 193 |
193 #if defined(OS_ANDROID) | 194 #if defined(OS_ANDROID) |
194 #include <cpu-features.h> | 195 #include <cpu-features.h> |
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 if (!frame->executeCommand(WebString::fromUTF8(it->name), | 1719 if (!frame->executeCommand(WebString::fromUTF8(it->name), |
1719 WebString::fromUTF8(it->value), | 1720 WebString::fromUTF8(it->value), |
1720 GetFocusedElement())) | 1721 GetFocusedElement())) |
1721 break; | 1722 break; |
1722 did_execute_command = true; | 1723 did_execute_command = true; |
1723 } | 1724 } |
1724 | 1725 |
1725 return did_execute_command; | 1726 return did_execute_command; |
1726 } | 1727 } |
1727 | 1728 |
| 1729 WebString RenderViewImpl::domCodeStringFromEnum(int dom_code) { |
| 1730 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
| 1731 static_cast<ui::DomCode>(dom_code))); |
| 1732 } |
| 1733 |
| 1734 int RenderViewImpl::domEnumFromCodeString(const WebString& code) { |
| 1735 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
| 1736 code.utf8().data())); |
| 1737 } |
| 1738 |
1728 bool RenderViewImpl::runFileChooser( | 1739 bool RenderViewImpl::runFileChooser( |
1729 const blink::WebFileChooserParams& params, | 1740 const blink::WebFileChooserParams& params, |
1730 WebFileChooserCompletion* chooser_completion) { | 1741 WebFileChooserCompletion* chooser_completion) { |
1731 // Do not open the file dialog in a hidden RenderView. | 1742 // Do not open the file dialog in a hidden RenderView. |
1732 if (is_hidden()) | 1743 if (is_hidden()) |
1733 return false; | 1744 return false; |
1734 FileChooserParams ipc_params; | 1745 FileChooserParams ipc_params; |
1735 if (params.directory) | 1746 if (params.directory) |
1736 ipc_params.mode = FileChooserParams::UploadFolder; | 1747 ipc_params.mode = FileChooserParams::UploadFolder; |
1737 else if (params.multiSelect) | 1748 else if (params.multiSelect) |
(...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4091 std::vector<gfx::Size> sizes; | 4102 std::vector<gfx::Size> sizes; |
4092 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4103 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4093 if (!url.isEmpty()) | 4104 if (!url.isEmpty()) |
4094 urls.push_back( | 4105 urls.push_back( |
4095 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4106 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4096 } | 4107 } |
4097 SendUpdateFaviconURL(urls); | 4108 SendUpdateFaviconURL(urls); |
4098 } | 4109 } |
4099 | 4110 |
4100 } // namespace content | 4111 } // namespace content |
OLD | NEW |