Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10024013: chromeos: Add support for the battery status API on chromeos. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 cached_is_main_frame_pinned_to_right_(false), 451 cached_is_main_frame_pinned_to_right_(false),
451 cached_has_main_frame_horizontal_scrollbar_(false), 452 cached_has_main_frame_horizontal_scrollbar_(false),
452 cached_has_main_frame_vertical_scrollbar_(false), 453 cached_has_main_frame_vertical_scrollbar_(false),
453 context_has_swapbuffers_complete_callback_(false), 454 context_has_swapbuffers_complete_callback_(false),
454 queried_for_swapbuffers_complete_callback_(false), 455 queried_for_swapbuffers_complete_callback_(false),
455 context_is_web_graphics_context_3d_command_buffer_impl_(false), 456 context_is_web_graphics_context_3d_command_buffer_impl_(false),
456 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)), 457 ALLOW_THIS_IN_INITIALIZER_LIST(cookie_jar_(this)),
457 geolocation_dispatcher_(NULL), 458 geolocation_dispatcher_(NULL),
458 input_tag_speech_dispatcher_(NULL), 459 input_tag_speech_dispatcher_(NULL),
459 device_orientation_dispatcher_(NULL), 460 device_orientation_dispatcher_(NULL),
461 battery_status_dispatcher_(NULL),
460 media_stream_dispatcher_(NULL), 462 media_stream_dispatcher_(NULL),
461 p2p_socket_dispatcher_(NULL), 463 p2p_socket_dispatcher_(NULL),
462 devtools_agent_(NULL), 464 devtools_agent_(NULL),
463 renderer_accessibility_(NULL), 465 renderer_accessibility_(NULL),
464 mouse_lock_dispatcher_(NULL), 466 mouse_lock_dispatcher_(NULL),
465 session_storage_namespace_id_(session_storage_namespace_id), 467 session_storage_namespace_id_(session_storage_namespace_id),
466 handling_select_range_(false), 468 handling_select_range_(false),
467 #if defined(OS_WIN) 469 #if defined(OS_WIN)
468 focused_plugin_id_(-1), 470 focused_plugin_id_(-1),
469 #endif 471 #endif
(...skipping 4614 matching lines...) Expand 10 before | Expand all | Expand 10 after
5084 #endif 5086 #endif
5085 return input_tag_speech_dispatcher_; 5087 return input_tag_speech_dispatcher_;
5086 } 5088 }
5087 5089
5088 WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() { 5090 WebKit::WebDeviceOrientationClient* RenderViewImpl::deviceOrientationClient() {
5089 if (!device_orientation_dispatcher_) 5091 if (!device_orientation_dispatcher_)
5090 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this); 5092 device_orientation_dispatcher_ = new DeviceOrientationDispatcher(this);
5091 return device_orientation_dispatcher_; 5093 return device_orientation_dispatcher_;
5092 } 5094 }
5093 5095
5096 WebKit::WebBatteryStatusClient* RenderViewImpl::batteryStatusClient() {
5097 if (!battery_status_dispatcher_)
5098 battery_status_dispatcher_ = new content::BatteryStatusDispatcher(this);
5099 return battery_status_dispatcher_;
5100 }
5101
5094 void RenderViewImpl::zoomLimitsChanged(double minimum_level, 5102 void RenderViewImpl::zoomLimitsChanged(double minimum_level,
5095 double maximum_level) { 5103 double maximum_level) {
5096 // For now, don't remember plugin zoom values. We don't want to mix them with 5104 // For now, don't remember plugin zoom values. We don't want to mix them with
5097 // normal web content (i.e. a fixed layout plugin would usually want them 5105 // normal web content (i.e. a fixed layout plugin would usually want them
5098 // different). 5106 // different).
5099 bool remember = !webview()->mainFrame()->document().isPluginDocument(); 5107 bool remember = !webview()->mainFrame()->document().isPluginDocument();
5100 5108
5101 int minimum_percent = static_cast<int>( 5109 int minimum_percent = static_cast<int>(
5102 WebView::zoomLevelToZoomFactor(minimum_level) * 100); 5110 WebView::zoomLevelToZoomFactor(minimum_level) * 100);
5103 int maximum_percent = static_cast<int>( 5111 int maximum_percent = static_cast<int>(
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
5241 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5249 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5242 return !!RenderThreadImpl::current()->compositor_thread(); 5250 return !!RenderThreadImpl::current()->compositor_thread();
5243 } 5251 }
5244 5252
5245 void RenderViewImpl::OnJavaBridgeInit() { 5253 void RenderViewImpl::OnJavaBridgeInit() {
5246 DCHECK(!java_bridge_dispatcher_.get()); 5254 DCHECK(!java_bridge_dispatcher_.get());
5247 #if defined(ENABLE_JAVA_BRIDGE) 5255 #if defined(ENABLE_JAVA_BRIDGE)
5248 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 5256 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
5249 #endif 5257 #endif
5250 } 5258 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698