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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 using WebKit::WebElement; | 248 using WebKit::WebElement; |
249 using WebKit::WebExternalPopupMenu; | 249 using WebKit::WebExternalPopupMenu; |
250 using WebKit::WebExternalPopupMenuClient; | 250 using WebKit::WebExternalPopupMenuClient; |
251 using WebKit::WebFileChooserCompletion; | 251 using WebKit::WebFileChooserCompletion; |
252 using WebKit::WebFileSystem; | 252 using WebKit::WebFileSystem; |
253 using WebKit::WebFileSystemCallbacks; | 253 using WebKit::WebFileSystemCallbacks; |
254 using WebKit::WebFindOptions; | 254 using WebKit::WebFindOptions; |
255 using WebKit::WebFormControlElement; | 255 using WebKit::WebFormControlElement; |
256 using WebKit::WebFormElement; | 256 using WebKit::WebFormElement; |
257 using WebKit::WebFrame; | 257 using WebKit::WebFrame; |
| 258 using WebKit::WebGestureEvent; |
258 using WebKit::WebGraphicsContext3D; | 259 using WebKit::WebGraphicsContext3D; |
259 using WebKit::WebHistoryItem; | 260 using WebKit::WebHistoryItem; |
260 using WebKit::WebHTTPBody; | 261 using WebKit::WebHTTPBody; |
261 using WebKit::WebIconURL; | 262 using WebKit::WebIconURL; |
262 using WebKit::WebImage; | 263 using WebKit::WebImage; |
263 using WebKit::WebInputElement; | 264 using WebKit::WebInputElement; |
| 265 using WebKit::WebInputEvent; |
264 using WebKit::WebIntentRequest; | 266 using WebKit::WebIntentRequest; |
265 using WebKit::WebIntentServiceInfo; | 267 using WebKit::WebIntentServiceInfo; |
266 using WebKit::WebMediaPlayer; | 268 using WebKit::WebMediaPlayer; |
267 using WebKit::WebMediaPlayerAction; | 269 using WebKit::WebMediaPlayerAction; |
268 using WebKit::WebMediaPlayerClient; | 270 using WebKit::WebMediaPlayerClient; |
269 using WebKit::WebMouseEvent; | 271 using WebKit::WebMouseEvent; |
270 using WebKit::WebNavigationPolicy; | 272 using WebKit::WebNavigationPolicy; |
271 using WebKit::WebNavigationType; | 273 using WebKit::WebNavigationType; |
272 using WebKit::WebNode; | 274 using WebKit::WebNode; |
273 using WebKit::WebPageSerializer; | 275 using WebKit::WebPageSerializer; |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2067 // seems safest to not execute the rest. | 2069 // seems safest to not execute the rest. |
2068 if (!frame->executeCommand(WebString::fromUTF8(it->name), | 2070 if (!frame->executeCommand(WebString::fromUTF8(it->name), |
2069 WebString::fromUTF8(it->value))) | 2071 WebString::fromUTF8(it->value))) |
2070 break; | 2072 break; |
2071 did_execute_command = true; | 2073 did_execute_command = true; |
2072 } | 2074 } |
2073 | 2075 |
2074 return did_execute_command; | 2076 return did_execute_command; |
2075 } | 2077 } |
2076 | 2078 |
| 2079 void RenderViewImpl::didHandleGestureEvent(const WebGestureEvent& event, |
| 2080 bool event_swallowed) { |
| 2081 #if defined(OS_ANDROID) |
| 2082 if (event.type == WebInputEvent::GestureTap || |
| 2083 event.type == WebInputEvent::GestureLongPress) { |
| 2084 UpdateTextInputState(SHOW_IME_IF_NEEDED); |
| 2085 } |
| 2086 #endif |
| 2087 } |
| 2088 |
2077 WebKit::WebColorChooser* RenderViewImpl::createColorChooser( | 2089 WebKit::WebColorChooser* RenderViewImpl::createColorChooser( |
2078 WebKit::WebColorChooserClient* client, | 2090 WebKit::WebColorChooserClient* client, |
2079 const WebKit::WebColor& initial_color) { | 2091 const WebKit::WebColor& initial_color) { |
2080 RendererWebColorChooserImpl* color_chooser = | 2092 RendererWebColorChooserImpl* color_chooser = |
2081 new RendererWebColorChooserImpl(this, client); | 2093 new RendererWebColorChooserImpl(this, client); |
2082 color_chooser->Open(static_cast<SkColor>(initial_color)); | 2094 color_chooser->Open(static_cast<SkColor>(initial_color)); |
2083 return color_chooser; | 2095 return color_chooser; |
2084 } | 2096 } |
2085 | 2097 |
2086 bool RenderViewImpl::runFileChooser( | 2098 bool RenderViewImpl::runFileChooser( |
(...skipping 3550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5637 (*plugin_it)->SetWindowFocus(true); | 5649 (*plugin_it)->SetWindowFocus(true); |
5638 #endif | 5650 #endif |
5639 (*plugin_it)->SetContentAreaFocus(enable); | 5651 (*plugin_it)->SetContentAreaFocus(enable); |
5640 } | 5652 } |
5641 } | 5653 } |
5642 // Notify all Pepper plugins. | 5654 // Notify all Pepper plugins. |
5643 pepper_delegate_.OnSetFocus(enable); | 5655 pepper_delegate_.OnSetFocus(enable); |
5644 } | 5656 } |
5645 | 5657 |
5646 void RenderViewImpl::PpapiPluginFocusChanged() { | 5658 void RenderViewImpl::PpapiPluginFocusChanged() { |
5647 UpdateTextInputState(); | 5659 UpdateTextInputState(DO_NOT_SHOW_IME); |
5648 UpdateSelectionBounds(); | 5660 UpdateSelectionBounds(); |
5649 } | 5661 } |
5650 | 5662 |
5651 void RenderViewImpl::PpapiPluginTextInputTypeChanged() { | 5663 void RenderViewImpl::PpapiPluginTextInputTypeChanged() { |
5652 UpdateTextInputState(); | 5664 UpdateTextInputState(DO_NOT_SHOW_IME); |
5653 if (renderer_accessibility_) | 5665 if (renderer_accessibility_) |
5654 renderer_accessibility_->FocusedNodeChanged(WebNode()); | 5666 renderer_accessibility_->FocusedNodeChanged(WebNode()); |
5655 } | 5667 } |
5656 | 5668 |
5657 void RenderViewImpl::PpapiPluginCaretPositionChanged() { | 5669 void RenderViewImpl::PpapiPluginCaretPositionChanged() { |
5658 UpdateSelectionBounds(); | 5670 UpdateSelectionBounds(); |
5659 } | 5671 } |
5660 | 5672 |
5661 bool RenderViewImpl::GetPpapiPluginCaretBounds(gfx::Rect* rect) { | 5673 bool RenderViewImpl::GetPpapiPluginCaretBounds(gfx::Rect* rect) { |
5662 if (!pepper_delegate_.IsPluginFocused()) | 5674 if (!pepper_delegate_.IsPluginFocused()) |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6181 | 6193 |
6182 updating_frame_tree_ = true; | 6194 updating_frame_tree_ = true; |
6183 active_frame_id_map_.clear(); | 6195 active_frame_id_map_.clear(); |
6184 | 6196 |
6185 target_process_id_ = process_id; | 6197 target_process_id_ = process_id; |
6186 target_routing_id_ = route_id; | 6198 target_routing_id_ = route_id; |
6187 CreateFrameTree(webview()->mainFrame(), frames); | 6199 CreateFrameTree(webview()->mainFrame(), frames); |
6188 | 6200 |
6189 updating_frame_tree_ = false; | 6201 updating_frame_tree_ = false; |
6190 } | 6202 } |
OLD | NEW |