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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "content/public/common/content_switches.h" | 46 #include "content/public/common/content_switches.h" |
47 #include "content/public/common/context_menu_params.h" | 47 #include "content/public/common/context_menu_params.h" |
48 #include "content/public/common/file_chooser_params.h" | 48 #include "content/public/common/file_chooser_params.h" |
49 #include "content/public/common/selected_file_info.h" | 49 #include "content/public/common/selected_file_info.h" |
50 #include "content/public/common/url_constants.h" | 50 #include "content/public/common/url_constants.h" |
51 #include "content/public/renderer/content_renderer_client.h" | 51 #include "content/public/renderer/content_renderer_client.h" |
52 #include "content/public/renderer/document_state.h" | 52 #include "content/public/renderer/document_state.h" |
53 #include "content/public/renderer/navigation_state.h" | 53 #include "content/public/renderer/navigation_state.h" |
54 #include "content/public/renderer/render_view_observer.h" | 54 #include "content/public/renderer/render_view_observer.h" |
55 #include "content/public/renderer/render_view_visitor.h" | 55 #include "content/public/renderer/render_view_visitor.h" |
| 56 #include "content/renderer/battery_status_dispatcher.h" |
56 #include "content/renderer/device_orientation_dispatcher.h" | 57 #include "content/renderer/device_orientation_dispatcher.h" |
57 #include "content/renderer/devtools_agent.h" | 58 #include "content/renderer/devtools_agent.h" |
58 #include "content/renderer/dom_automation_controller.h" | 59 #include "content/renderer/dom_automation_controller.h" |
59 #include "content/renderer/external_popup_menu.h" | 60 #include "content/renderer/external_popup_menu.h" |
60 #include "content/renderer/geolocation_dispatcher.h" | 61 #include "content/renderer/geolocation_dispatcher.h" |
61 #include "content/renderer/gpu/compositor_thread.h" | 62 #include "content/renderer/gpu/compositor_thread.h" |
62 #include "content/renderer/idle_user_detector.h" | 63 #include "content/renderer/idle_user_detector.h" |
63 #include "content/renderer/input_tag_speech_dispatcher.h" | 64 #include "content/renderer/input_tag_speech_dispatcher.h" |
64 #include "content/renderer/java/java_bridge_dispatcher.h" | 65 #include "content/renderer/java/java_bridge_dispatcher.h" |
65 #include "content/renderer/load_progress_tracker.h" | 66 #include "content/renderer/load_progress_tracker.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 cached_is_main_frame_pinned_to_right_(false), | 450 cached_is_main_frame_pinned_to_right_(false), |
450 cached_has_main_frame_horizontal_scrollbar_(false), | 451 cached_has_main_frame_horizontal_scrollbar_(false), |
451 cached_has_main_frame_vertical_scrollbar_(false), | 452 cached_has_main_frame_vertical_scrollbar_(false), |
452 context_has_swapbuffers_complete_callback_(false), | 453 context_has_swapbuffers_complete_callback_(false), |
453 queried_for_swapbuffers_complete_callback_(false), | 454 queried_for_swapbuffers_complete_callback_(false), |
454 context_is_web_graphics_context_3d_command_buffer_impl_(false), | 455 context_is_web_graphics_context_3d_command_buffer_impl_(false), |
455 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), | 456 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), |
456 geolocation_dispatcher_(NULL), | 457 geolocation_dispatcher_(NULL), |
457 input_tag_speech_dispatcher_(NULL), | 458 input_tag_speech_dispatcher_(NULL), |
458 device_orientation_dispatcher_(NULL), | 459 device_orientation_dispatcher_(NULL), |
| 460 battery_status_dispatcher_(NULL), |
459 media_stream_dispatcher_(NULL), | 461 media_stream_dispatcher_(NULL), |
460 p2p_socket_dispatcher_(NULL), | 462 p2p_socket_dispatcher_(NULL), |
461 devtools_agent_(NULL), | 463 devtools_agent_(NULL), |
462 renderer_accessibility_(NULL), | 464 renderer_accessibility_(NULL), |
463 mouse_lock_dispatcher_(NULL), | 465 mouse_lock_dispatcher_(NULL), |
464 session_storage_namespace_id_(session_storage_namespace_id), | 466 session_storage_namespace_id_(session_storage_namespace_id), |
465 handling_select_range_(false), | 467 handling_select_range_(false), |
466 #if defined(OS_WIN) | 468 #if defined(OS_WIN) |
467 focused_plugin_id_(-1), | 469 focused_plugin_id_(-1), |
468 #endif | 470 #endif |
(...skipping 4614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5083 #endif | 5085 #endif |
5084 return input_tag_speech_dispatcher_; | 5086 return input_tag_speech_dispatcher_; |
5085 } | 5087 } |
5086 | 5088 |
5087 WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() { | 5089 WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() { |
5088 if (!device_orientation_dispatcher_) | 5090 if (!device_orientation_dispatcher_) |
5089 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); | 5091 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); |
5090 return device_orientation_dispatcher_; | 5092 return device_orientation_dispatcher_; |
5091 } | 5093 } |
5092 | 5094 |
| 5095 WebKit::WebBatteryStatusClient* RenderViewImpl::batteryStatusClient() { |
| 5096 if (!battery_status_dispatcher_) |
| 5097 battery_status_dispatcher_ = new BatteryStatusDispatcher(this); |
| 5098 return battery_status_dispatcher_; |
| 5099 } |
| 5100 |
5093 void RenderViewImpl::zoomLimitsChanged(double minimum_level, | 5101 void RenderViewImpl::zoomLimitsChanged(double minimum_level, |
5094 double maximum_level) { | 5102 double maximum_level) { |
5095 // For now, don't remember plugin zoom values. We don't want to mix them with | 5103 // For now, don't remember plugin zoom values. We don't want to mix them with |
5096 // normal web content (i.e. a fixed layout plugin would usually want them | 5104 // normal web content (i.e. a fixed layout plugin would usually want them |
5097 // different). | 5105 // different). |
5098 bool remember = !webview()->mainFrame()->document().isPluginDocument(); | 5106 bool remember = !webview()->mainFrame()->document().isPluginDocument(); |
5099 | 5107 |
5100 int minimum_percent = static_cast<int>( | 5108 int minimum_percent = static_cast<int>( |
5101 WebView::zoomLevelToZoomFactor(minimum_level) * 100); | 5109 WebView::zoomLevelToZoomFactor(minimum_level) * 100); |
5102 int maximum_percent = static_cast<int>( | 5110 int maximum_percent = static_cast<int>( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5240 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5248 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5241 return !!RenderThreadImpl::current()->compositor_thread(); | 5249 return !!RenderThreadImpl::current()->compositor_thread(); |
5242 } | 5250 } |
5243 | 5251 |
5244 void RenderViewImpl::OnJavaBridgeInit() { | 5252 void RenderViewImpl::OnJavaBridgeInit() { |
5245 DCHECK(!java_bridge_dispatcher_.get()); | 5253 DCHECK(!java_bridge_dispatcher_.get()); |
5246 #if defined(ENABLE_JAVA_BRIDGE) | 5254 #if defined(ENABLE_JAVA_BRIDGE) |
5247 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5255 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5248 #endif | 5256 #endif |
5249 } | 5257 } |
OLD | NEW |