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/bind.h" | 10 #include "base/bind.h" |
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2118 // seems safest to not execute the rest. | 2118 // seems safest to not execute the rest. |
2119 if (!frame->executeCommand(WebString::fromUTF8(it->name), | 2119 if (!frame->executeCommand(WebString::fromUTF8(it->name), |
2120 WebString::fromUTF8(it->value))) | 2120 WebString::fromUTF8(it->value))) |
2121 break; | 2121 break; |
2122 did_execute_command = true; | 2122 did_execute_command = true; |
2123 } | 2123 } |
2124 | 2124 |
2125 return did_execute_command; | 2125 return did_execute_command; |
2126 } | 2126 } |
2127 | 2127 |
2128 void RenderViewImpl::didHandleGestureEvent(const WebGestureEvent& event, | |
2129 bool event_swallowed) { | |
2130 #if defined(OS_ANDROID) | |
2131 if (event.type == WebInputEvent::GestureTap || | |
2132 event.type == WebInputEvent::GestureLongPress) { | |
2133 UpdateTextInputState(SHOW_IME_IF_NEEDED); | |
2134 } | |
2135 #endif | |
2136 FOR_EACH_OBSERVER(RenderViewObserver, observers_, | |
2137 DidHandleGestureEvent(event)); | |
2138 } | |
2139 | |
2140 WebKit::WebColorChooser* RenderViewImpl::createColorChooser( | 2128 WebKit::WebColorChooser* RenderViewImpl::createColorChooser( |
2141 WebKit::WebColorChooserClient* client, | 2129 WebKit::WebColorChooserClient* client, |
2142 const WebKit::WebColor& initial_color) { | 2130 const WebKit::WebColor& initial_color) { |
2143 RendererWebColorChooserImpl* color_chooser = | 2131 RendererWebColorChooserImpl* color_chooser = |
2144 new RendererWebColorChooserImpl(this, client); | 2132 new RendererWebColorChooserImpl(this, client); |
2145 color_chooser->Open(static_cast<SkColor>(initial_color)); | 2133 color_chooser->Open(static_cast<SkColor>(initial_color)); |
2146 return color_chooser; | 2134 return color_chooser; |
2147 } | 2135 } |
2148 | 2136 |
2149 bool RenderViewImpl::runFileChooser( | 2137 bool RenderViewImpl::runFileChooser( |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 compositor_thread->AddInputHandler( | 2533 compositor_thread->AddInputHandler( |
2546 routing_id_, input_handler_identifier, AsWeakPtr()); | 2534 routing_id_, input_handler_identifier, AsWeakPtr()); |
2547 #endif | 2535 #endif |
2548 #endif | 2536 #endif |
2549 | 2537 |
2550 RenderWidget::didActivateCompositor(input_handler_identifier); | 2538 RenderWidget::didActivateCompositor(input_handler_identifier); |
2551 | 2539 |
2552 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); | 2540 ProcessAcceleratedPinchZoomFlags(*CommandLine::ForCurrentProcess()); |
2553 } | 2541 } |
2554 | 2542 |
| 2543 void RenderViewImpl::didHandleGestureEvent( |
| 2544 const WebGestureEvent& event, |
| 2545 bool event_cancelled) { |
| 2546 RenderWidget::didHandleGestureEvent(event, event_cancelled); |
| 2547 FOR_EACH_OBSERVER(RenderViewObserver, observers_, |
| 2548 DidHandleGestureEvent(event)); |
| 2549 } |
| 2550 |
2555 // WebKit::WebFrameClient ----------------------------------------------------- | 2551 // WebKit::WebFrameClient ----------------------------------------------------- |
2556 | 2552 |
2557 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, | 2553 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, |
2558 const WebPluginParams& params) { | 2554 const WebPluginParams& params) { |
2559 WebPlugin* plugin = NULL; | 2555 WebPlugin* plugin = NULL; |
2560 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 2556 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
2561 this, frame, params, &plugin)) { | 2557 this, frame, params, &plugin)) { |
2562 return plugin; | 2558 return plugin; |
2563 } | 2559 } |
2564 | 2560 |
(...skipping 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6595 } | 6591 } |
6596 #endif | 6592 #endif |
6597 | 6593 |
6598 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6594 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6599 TransportDIB::Handle dib_handle) { | 6595 TransportDIB::Handle dib_handle) { |
6600 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6596 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6601 RenderProcess::current()->ReleaseTransportDIB(dib); | 6597 RenderProcess::current()->ReleaseTransportDIB(dib); |
6602 } | 6598 } |
6603 | 6599 |
6604 } // namespace content | 6600 } // namespace content |
OLD | NEW |