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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 #include "content/renderer/notification_provider.h" | 67 #include "content/renderer/notification_provider.h" |
68 #include "content/renderer/p2p/socket_dispatcher.h" | 68 #include "content/renderer/p2p/socket_dispatcher.h" |
69 #include "content/renderer/plugin_channel_host.h" | 69 #include "content/renderer/plugin_channel_host.h" |
70 #include "content/renderer/render_audiosourceprovider.h" | 70 #include "content/renderer/render_audiosourceprovider.h" |
71 #include "content/renderer/render_process.h" | 71 #include "content/renderer/render_process.h" |
72 #include "content/renderer/render_thread_impl.h" | 72 #include "content/renderer/render_thread_impl.h" |
73 #include "content/renderer/render_widget_fullscreen_pepper.h" | 73 #include "content/renderer/render_widget_fullscreen_pepper.h" |
74 #include "content/renderer/renderer_accessibility.h" | 74 #include "content/renderer/renderer_accessibility.h" |
75 #include "content/renderer/renderer_gpu_video_decoder_factories.h" | 75 #include "content/renderer/renderer_gpu_video_decoder_factories.h" |
76 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 76 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
77 #include "content/renderer/renderer_webcolorchooser_impl.h" | |
77 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 78 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
78 #include "content/renderer/speech_input_dispatcher.h" | 79 #include "content/renderer/speech_input_dispatcher.h" |
79 #include "content/renderer/text_input_client_observer.h" | 80 #include "content/renderer/text_input_client_observer.h" |
80 #include "content/renderer/v8_value_converter_impl.h" | 81 #include "content/renderer/v8_value_converter_impl.h" |
81 #include "content/renderer/web_ui_bindings.h" | 82 #include "content/renderer/web_ui_bindings.h" |
82 #include "content/renderer/webplugin_delegate_proxy.h" | 83 #include "content/renderer/webplugin_delegate_proxy.h" |
83 #include "content/renderer/websharedworker_proxy.h" | 84 #include "content/renderer/websharedworker_proxy.h" |
84 #include "media/base/filter_collection.h" | 85 #include "media/base/filter_collection.h" |
85 #include "media/base/media_switches.h" | 86 #include "media/base/media_switches.h" |
86 #include "media/base/message_loop_factory_impl.h" | 87 #include "media/base/message_loop_factory_impl.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
367 cached_has_main_frame_horizontal_scrollbar_(false), | 368 cached_has_main_frame_horizontal_scrollbar_(false), |
368 cached_has_main_frame_vertical_scrollbar_(false), | 369 cached_has_main_frame_vertical_scrollbar_(false), |
369 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 370 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
370 geolocation_dispatcher_(NULL), | 371 geolocation_dispatcher_(NULL), |
371 speech_input_dispatcher_(NULL), | 372 speech_input_dispatcher_(NULL), |
372 device_orientation_dispatcher_(NULL), | 373 device_orientation_dispatcher_(NULL), |
373 media_stream_dispatcher_(NULL), | 374 media_stream_dispatcher_(NULL), |
374 p2p_socket_dispatcher_(NULL), | 375 p2p_socket_dispatcher_(NULL), |
375 devtools_agent_(NULL), | 376 devtools_agent_(NULL), |
376 renderer_accessibility_(NULL), | 377 renderer_accessibility_(NULL), |
378 color_chooser_(NULL), | |
377 session_storage_namespace_id_(session_storage_namespace_id), | 379 session_storage_namespace_id_(session_storage_namespace_id), |
378 handling_select_range_(false), | 380 handling_select_range_(false), |
379 #if defined(OS_WIN) | 381 #if defined(OS_WIN) |
380 focused_plugin_id_(-1), | 382 focused_plugin_id_(-1), |
381 #endif | 383 #endif |
382 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { | 384 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { |
383 routing_id_ = routing_id; | 385 routing_id_ = routing_id; |
384 surface_id_ = surface_id; | 386 surface_id_ = surface_id; |
385 if (opener_id != MSG_ROUTING_NONE) | 387 if (opener_id != MSG_ROUTING_NONE) |
386 opener_id_ = opener_id; | 388 opener_id_ = opener_id; |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1601 // seems safest to not execute the rest. | 1603 // seems safest to not execute the rest. |
1602 if (!frame->executeCommand(WebString::fromUTF8(it->name), | 1604 if (!frame->executeCommand(WebString::fromUTF8(it->name), |
1603 WebString::fromUTF8(it->value))) | 1605 WebString::fromUTF8(it->value))) |
1604 break; | 1606 break; |
1605 did_execute_command = true; | 1607 did_execute_command = true; |
1606 } | 1608 } |
1607 | 1609 |
1608 return did_execute_command; | 1610 return did_execute_command; |
1609 } | 1611 } |
1610 | 1612 |
1613 WebKit::WebColorChooser* RenderViewImpl::createColorChooser( | |
1614 WebKit::WebColorChooserClient* client, | |
1615 const WebKit::WebColor& initial_color) { | |
1616 if (color_chooser_) | |
1617 color_chooser_->endChooser(); | |
1618 color_chooser_ = new RendererWebColorChooserImpl(this, client); | |
1619 Send(new ViewHostMsg_OpenColorChooser(routing_id_, initial_color)); | |
1620 return static_cast<WebKit::WebColorChooser*>(color_chooser_); | |
1621 } | |
1622 | |
1623 void RenderViewImpl::endColorChooser() { | |
jam
2012/01/27 18:13:40
I don't think this function is needed.
The colorc
keishi
2012/02/06 15:01:57
This pointer was used to end the ColorChooser insi
jam
2012/02/07 02:51:46
Perhaps I wasn't clear. I don't think this is need
| |
1624 color_chooser_ = NULL; | |
1625 } | |
1626 | |
1611 bool RenderViewImpl::runFileChooser( | 1627 bool RenderViewImpl::runFileChooser( |
1612 const WebKit::WebFileChooserParams& params, | 1628 const WebKit::WebFileChooserParams& params, |
1613 WebFileChooserCompletion* chooser_completion) { | 1629 WebFileChooserCompletion* chooser_completion) { |
1614 // Do not open the file dialog in a hidden RenderView. | 1630 // Do not open the file dialog in a hidden RenderView. |
1615 if (is_hidden()) | 1631 if (is_hidden()) |
1616 return false; | 1632 return false; |
1617 content::FileChooserParams ipc_params; | 1633 content::FileChooserParams ipc_params; |
1618 if (params.directory) | 1634 if (params.directory) |
1619 ipc_params.mode = content::FileChooserParams::OpenFolder; | 1635 ipc_params.mode = content::FileChooserParams::OpenFolder; |
1620 else if (params.multiSelect) | 1636 else if (params.multiSelect) |
(...skipping 2483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4104 | 4120 |
4105 WebPageSerializer::serialize(webview()->mainFrame(), true, this, weburl_links, | 4121 WebPageSerializer::serialize(webview()->mainFrame(), true, this, weburl_links, |
4106 webstring_paths, | 4122 webstring_paths, |
4107 webkit_glue::FilePathToWebString( | 4123 webkit_glue::FilePathToWebString( |
4108 local_directory_name)); | 4124 local_directory_name)); |
4109 } | 4125 } |
4110 | 4126 |
4111 void RenderViewImpl::OnShouldClose() { | 4127 void RenderViewImpl::OnShouldClose() { |
4112 bool should_close = webview()->dispatchBeforeUnloadEvent(); | 4128 bool should_close = webview()->dispatchBeforeUnloadEvent(); |
4113 Send(new ViewHostMsg_ShouldClose_ACK(routing_id_, should_close)); | 4129 Send(new ViewHostMsg_ShouldClose_ACK(routing_id_, should_close)); |
4130 if (color_chooser_) | |
4131 color_chooser_->endChooser(); | |
4114 } | 4132 } |
4115 | 4133 |
4116 void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) { | 4134 void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) { |
4117 if (is_swapped_out_) | 4135 if (is_swapped_out_) |
4118 return; | 4136 return; |
4119 | 4137 |
4120 // Swap this RenderView out so the tab can navigate to a page rendered by a | 4138 // Swap this RenderView out so the tab can navigate to a page rendered by a |
4121 // different process. This involves running the unload handler and clearing | 4139 // different process. This involves running the unload handler and clearing |
4122 // the page. Once WasSwappedOut is called, we also allow this process to exit | 4140 // the page. Once WasSwappedOut is called, we also allow this process to exit |
4123 // if there are no other active RenderViews in it. | 4141 // if there are no other active RenderViews in it. |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4915 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4933 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4916 return !!RenderThreadImpl::current()->compositor_thread(); | 4934 return !!RenderThreadImpl::current()->compositor_thread(); |
4917 } | 4935 } |
4918 | 4936 |
4919 void RenderViewImpl::OnJavaBridgeInit() { | 4937 void RenderViewImpl::OnJavaBridgeInit() { |
4920 DCHECK(!java_bridge_dispatcher_.get()); | 4938 DCHECK(!java_bridge_dispatcher_.get()); |
4921 #if defined(ENABLE_JAVA_BRIDGE) | 4939 #if defined(ENABLE_JAVA_BRIDGE) |
4922 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4940 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4923 #endif | 4941 #endif |
4924 } | 4942 } |
OLD | NEW |