OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/json/json_value_serializer.h" | 15 #include "base/json/json_value_serializer.h" |
16 #include "base/json/json_writer.h" | 16 #include "base/json/json_writer.h" |
17 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/process_util.h" | 20 #include "base/process_util.h" |
21 #include "base/string_piece.h" | 21 #include "base/string_piece.h" |
22 #include "base/string_split.h" | 22 #include "base/string_split.h" |
23 #include "base/string_util.h" | 23 #include "base/string_util.h" |
24 #include "base/sys_string_conversions.h" | 24 #include "base/sys_string_conversions.h" |
25 #include "base/time.h" | 25 #include "base/time.h" |
26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
| 27 #include "content/common/autofill_messages.h" |
27 #include "content/common/appcache/appcache_dispatcher.h" | 28 #include "content/common/appcache/appcache_dispatcher.h" |
28 #include "content/common/clipboard_messages.h" | 29 #include "content/common/clipboard_messages.h" |
29 #include "content/common/content_constants.h" | 30 #include "content/common/content_constants.h" |
30 #include "content/common/database_messages.h" | 31 #include "content/common/database_messages.h" |
31 #include "content/common/drag_messages.h" | 32 #include "content/common/drag_messages.h" |
32 #include "content/common/file_system/file_system_dispatcher.h" | 33 #include "content/common/file_system/file_system_dispatcher.h" |
33 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 34 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
34 #include "content/common/intents_messages.h" | 35 #include "content/common/intents_messages.h" |
35 #include "content/common/notification_service.h" | 36 #include "content/common/notification_service.h" |
36 #include "content/common/pepper_messages.h" | 37 #include "content/common/pepper_messages.h" |
37 #include "content/common/pepper_plugin_registry.h" | 38 #include "content/common/pepper_plugin_registry.h" |
38 #include "content/common/quota_dispatcher.h" | 39 #include "content/common/quota_dispatcher.h" |
39 #include "content/common/renderer_preferences.h" | 40 #include "content/common/renderer_preferences.h" |
40 #include "content/common/request_extra_data.h" | 41 #include "content/common/request_extra_data.h" |
41 #include "content/common/view_messages.h" | 42 #include "content/common/view_messages.h" |
42 #include "content/public/common/bindings_policy.h" | 43 #include "content/public/common/bindings_policy.h" |
43 #include "content/public/common/content_switches.h" | 44 #include "content/public/common/content_switches.h" |
44 #include "content/public/common/url_constants.h" | 45 #include "content/public/common/url_constants.h" |
45 #include "content/public/renderer/content_renderer_client.h" | 46 #include "content/public/renderer/content_renderer_client.h" |
46 #include "content/public/renderer/navigation_state.h" | 47 #include "content/public/renderer/navigation_state.h" |
47 #include "content/public/renderer/render_view_observer.h" | 48 #include "content/public/renderer/render_view_observer.h" |
48 #include "content/public/renderer/render_view_visitor.h" | 49 #include "content/public/renderer/render_view_visitor.h" |
| 50 #include "content/renderer/autofill_dispatcher.h" |
49 #include "content/renderer/device_orientation_dispatcher.h" | 51 #include "content/renderer/device_orientation_dispatcher.h" |
50 #include "content/renderer/devtools_agent.h" | 52 #include "content/renderer/devtools_agent.h" |
51 #include "content/renderer/external_popup_menu.h" | 53 #include "content/renderer/external_popup_menu.h" |
52 #include "content/renderer/geolocation_dispatcher.h" | 54 #include "content/renderer/geolocation_dispatcher.h" |
53 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 55 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
54 #include "content/renderer/intents_dispatcher.h" | 56 #include "content/renderer/intents_dispatcher.h" |
55 #include "content/renderer/load_progress_tracker.h" | 57 #include "content/renderer/load_progress_tracker.h" |
56 #include "content/renderer/media/audio_message_filter.h" | 58 #include "content/renderer/media/audio_message_filter.h" |
57 #include "content/renderer/media/audio_renderer_impl.h" | 59 #include "content/renderer/media/audio_renderer_impl.h" |
58 #include "content/renderer/media/media_stream_impl.h" | 60 #include "content/renderer/media/media_stream_impl.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 cached_has_main_frame_vertical_scrollbar_(false), | 334 cached_has_main_frame_vertical_scrollbar_(false), |
333 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), | 335 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)), |
334 #if defined(OS_WIN) | 336 #if defined(OS_WIN) |
335 focused_plugin_id_(-1), | 337 focused_plugin_id_(-1), |
336 #endif | 338 #endif |
337 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 339 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
338 geolocation_dispatcher_(NULL), | 340 geolocation_dispatcher_(NULL), |
339 speech_input_dispatcher_(NULL), | 341 speech_input_dispatcher_(NULL), |
340 device_orientation_dispatcher_(NULL), | 342 device_orientation_dispatcher_(NULL), |
341 p2p_socket_dispatcher_(NULL), | 343 p2p_socket_dispatcher_(NULL), |
| 344 autofill_dispatcher_(NULL), |
342 devtools_agent_(NULL), | 345 devtools_agent_(NULL), |
343 renderer_accessibility_(NULL), | 346 renderer_accessibility_(NULL), |
344 session_storage_namespace_id_(session_storage_namespace_id), | 347 session_storage_namespace_id_(session_storage_namespace_id), |
345 handling_select_range_(false) { | 348 handling_select_range_(false) { |
346 routing_id_ = routing_id; | 349 routing_id_ = routing_id; |
347 if (opener_id != MSG_ROUTING_NONE) | 350 if (opener_id != MSG_ROUTING_NONE) |
348 opener_id_ = opener_id; | 351 opener_id_ = opener_id; |
349 | 352 |
350 webwidget_ = WebView::create(this); | 353 webwidget_ = WebView::create(this); |
351 | 354 |
352 if (counter) { | 355 if (counter) { |
353 shared_popup_counter_ = counter; | 356 shared_popup_counter_ = counter; |
354 shared_popup_counter_->data++; | 357 shared_popup_counter_->data++; |
355 decrement_shared_popup_at_destruction_ = true; | 358 decrement_shared_popup_at_destruction_ = true; |
356 } else { | 359 } else { |
357 shared_popup_counter_ = new SharedRenderViewCounter(0); | 360 shared_popup_counter_ = new SharedRenderViewCounter(0); |
358 decrement_shared_popup_at_destruction_ = false; | 361 decrement_shared_popup_at_destruction_ = false; |
359 } | 362 } |
360 | 363 |
361 intents_dispatcher_ = new IntentsDispatcher(this); | 364 intents_dispatcher_ = new IntentsDispatcher(this); |
362 notification_provider_ = new NotificationProvider(this); | 365 notification_provider_ = new NotificationProvider(this); |
| 366 autofill_dispatcher_ = new AutofillDispatcher(this); |
363 | 367 |
364 RenderThread::Get()->AddRoute(routing_id_, this); | 368 RenderThread::Get()->AddRoute(routing_id_, this); |
365 // Take a reference on behalf of the RenderThread. This will be balanced | 369 // Take a reference on behalf of the RenderThread. This will be balanced |
366 // when we receive ViewMsg_ClosePage. | 370 // when we receive ViewMsg_ClosePage. |
367 AddRef(); | 371 AddRef(); |
368 | 372 |
369 // If this is a popup, we must wait for the CreatingNew_ACK message before | 373 // If this is a popup, we must wait for the CreatingNew_ACK message before |
370 // completing initialization. Otherwise, we can finish it now. | 374 // completing initialization. Otherwise, we can finish it now. |
371 if (opener_id == MSG_ROUTING_NONE) { | 375 if (opener_id == MSG_ROUTING_NONE) { |
372 did_show_ = true; | 376 did_show_ = true; |
(...skipping 4246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 pepper_delegate_.OnLockMouseACK(succeeded); | 4623 pepper_delegate_.OnLockMouseACK(succeeded); |
4620 } | 4624 } |
4621 | 4625 |
4622 void RenderViewImpl::OnMouseLockLost() { | 4626 void RenderViewImpl::OnMouseLockLost() { |
4623 pepper_delegate_.OnMouseLockLost(); | 4627 pepper_delegate_.OnMouseLockLost(); |
4624 } | 4628 } |
4625 | 4629 |
4626 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4630 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4627 return webview()->settings()->useThreadedCompositor(); | 4631 return webview()->settings()->useThreadedCompositor(); |
4628 } | 4632 } |
OLD | NEW |