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 4607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5076 #endif | 5078 #endif |
5077 return input_tag_speech_dispatcher_; | 5079 return input_tag_speech_dispatcher_; |
5078 } | 5080 } |
5079 | 5081 |
5080 WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() { | 5082 WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() { |
5081 if (!device_orientation_dispatcher_) | 5083 if (!device_orientation_dispatcher_) |
5082 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); | 5084 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); |
5083 return device_orientation_dispatcher_; | 5085 return device_orientation_dispatcher_; |
5084 } | 5086 } |
5085 | 5087 |
| 5088 WebKit::WebBatteryStatusClient* RenderViewImpl::batteryStatusClient() { |
| 5089 #if defined(OS_CHROMEOS) |
| 5090 if (!battery_status_dispatcher_) |
| 5091 battery_status_dispatcher_ = new BatteryStatusDispatcher(this); |
| 5092 #endif |
| 5093 return battery_status_dispatcher_; |
| 5094 } |
| 5095 |
5086 void RenderViewImpl::zoomLimitsChanged(double minimum_level, | 5096 void RenderViewImpl::zoomLimitsChanged(double minimum_level, |
5087 double maximum_level) { | 5097 double maximum_level) { |
5088 // For now, don't remember plugin zoom values. We don't want to mix them with | 5098 // For now, don't remember plugin zoom values. We don't want to mix them with |
5089 // normal web content (i.e. a fixed layout plugin would usually want them | 5099 // normal web content (i.e. a fixed layout plugin would usually want them |
5090 // different). | 5100 // different). |
5091 bool remember = !webview()->mainFrame()->document().isPluginDocument(); | 5101 bool remember = !webview()->mainFrame()->document().isPluginDocument(); |
5092 | 5102 |
5093 int minimum_percent = static_cast<int>( | 5103 int minimum_percent = static_cast<int>( |
5094 WebView::zoomLevelToZoomFactor(minimum_level) * 100); | 5104 WebView::zoomLevelToZoomFactor(minimum_level) * 100); |
5095 int maximum_percent = static_cast<int>( | 5105 int maximum_percent = static_cast<int>( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5233 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5243 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5234 return !!RenderThreadImpl::current()->compositor_thread(); | 5244 return !!RenderThreadImpl::current()->compositor_thread(); |
5235 } | 5245 } |
5236 | 5246 |
5237 void RenderViewImpl::OnJavaBridgeInit() { | 5247 void RenderViewImpl::OnJavaBridgeInit() { |
5238 DCHECK(!java_bridge_dispatcher_.get()); | 5248 DCHECK(!java_bridge_dispatcher_.get()); |
5239 #if defined(ENABLE_JAVA_BRIDGE) | 5249 #if defined(ENABLE_JAVA_BRIDGE) |
5240 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5250 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5241 #endif | 5251 #endif |
5242 } | 5252 } |
OLD | NEW |