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

Side by Side Diff: content/renderer/render_thread_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, 5 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_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 28 matching lines...) Expand all
39 #include "content/common/resource_messages.h" 39 #include "content/common/resource_messages.h"
40 #include "content/common/view_messages.h" 40 #include "content/common/view_messages.h"
41 #include "content/common/web_database_observer_impl.h" 41 #include "content/common/web_database_observer_impl.h"
42 #include "content/public/common/content_paths.h" 42 #include "content/public/common/content_paths.h"
43 #include "content/public/common/content_switches.h" 43 #include "content/public/common/content_switches.h"
44 #include "content/public/common/renderer_preferences.h" 44 #include "content/public/common/renderer_preferences.h"
45 #include "content/public/common/url_constants.h" 45 #include "content/public/common/url_constants.h"
46 #include "content/public/renderer/content_renderer_client.h" 46 #include "content/public/renderer/content_renderer_client.h"
47 #include "content/public/renderer/render_process_observer.h" 47 #include "content/public/renderer/render_process_observer.h"
48 #include "content/public/renderer/render_view_visitor.h" 48 #include "content/public/renderer/render_view_visitor.h"
49 #include "content/renderer/battery_status_dispatcher.h"
49 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" 50 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h"
50 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h" 51 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h"
51 #include "content/renderer/devtools_agent_filter.h" 52 #include "content/renderer/devtools_agent_filter.h"
52 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" 53 #include "content/renderer/dom_storage/dom_storage_dispatcher.h"
53 #include "content/renderer/dom_storage/webstoragearea_impl.h" 54 #include "content/renderer/dom_storage/webstoragearea_impl.h"
54 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 55 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
55 #include "content/renderer/gpu/compositor_thread.h" 56 #include "content/renderer/gpu/compositor_thread.h"
56 #include "content/renderer/gpu/gpu_benchmarking_extension.h" 57 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
57 #include "content/renderer/media/audio_input_message_filter.h" 58 #include "content/renderer/media/audio_input_message_filter.h"
58 #include "content/renderer/media/audio_message_filter.h" 59 #include "content/renderer/media/audio_message_filter.h"
59 #include "content/renderer/media/media_stream_center.h" 60 #include "content/renderer/media/media_stream_center.h"
60 #include "content/renderer/media/video_capture_impl_manager.h" 61 #include "content/renderer/media/video_capture_impl_manager.h"
61 #include "content/renderer/media/video_capture_message_filter.h" 62 #include "content/renderer/media/video_capture_message_filter.h"
62 #include "content/renderer/plugin_channel_host.h" 63 #include "content/renderer/plugin_channel_host.h"
63 #include "content/renderer/render_process_impl.h" 64 #include "content/renderer/render_process_impl.h"
64 #include "content/renderer/render_view_impl.h" 65 #include "content/renderer/render_view_impl.h"
65 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 66 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
66 #include "grit/content_resources.h" 67 #include "grit/content_resources.h"
67 #include "ipc/ipc_channel_handle.h" 68 #include "ipc/ipc_channel_handle.h"
68 #include "ipc/ipc_platform_file.h" 69 #include "ipc/ipc_platform_file.h"
69 #include "media/base/media.h" 70 #include "media/base/media.h"
70 #include "net/base/net_errors.h" 71 #include "net/base/net_errors.h"
71 #include "net/base/net_util.h" 72 #include "net/base/net_util.h"
73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBatteryMonitor.h"
72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h" 74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h"
73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" 75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" 76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi er.h" 80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifi er.h"
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h"
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h " 83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h "
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { 995 GpuChannelHost* RenderThreadImpl::GetGpuChannel() {
994 if (!gpu_channel_.get()) 996 if (!gpu_channel_.get())
995 return NULL; 997 return NULL;
996 998
997 if (gpu_channel_->state() != GpuChannelHost::kConnected) 999 if (gpu_channel_->state() != GpuChannelHost::kConnected)
998 return NULL; 1000 return NULL;
999 1001
1000 return gpu_channel_.get(); 1002 return gpu_channel_.get();
1001 } 1003 }
1002 1004
1005 WebKit::WebBatteryMonitor* RenderThreadImpl::GetBatteryMonitor() {
1006 #if defined(OS_CHROMEOS)
1007 if (!battery_monitor_.get()) {
1008 content::BatteryStatusDispatcher* dispatcher =
1009 new content::BatteryStatusDispatcher;
1010 battery_monitor_.reset(dispatcher);
1011 AddObserver(dispatcher);
1012 }
1013 #endif
1014 return battery_monitor_.get();
1015 }
1016
1003 void RenderThreadImpl::OnPurgePluginListCache(bool reload_pages) { 1017 void RenderThreadImpl::OnPurgePluginListCache(bool reload_pages) {
1004 EnsureWebKitInitialized(); 1018 EnsureWebKitInitialized();
1005 // The call below will cause a GetPlugins call with refresh=true, but at this 1019 // The call below will cause a GetPlugins call with refresh=true, but at this
1006 // point we already know that the browser has refreshed its list, so disable 1020 // point we already know that the browser has refreshed its list, so disable
1007 // refresh temporarily to prevent each renderer process causing the list to be 1021 // refresh temporarily to prevent each renderer process causing the list to be
1008 // regenerated. 1022 // regenerated.
1009 plugin_refresh_allowed_ = false; 1023 plugin_refresh_allowed_ = false;
1010 WebKit::resetPluginCache(reload_pages); 1024 WebKit::resetPluginCache(reload_pages);
1011 plugin_refresh_allowed_ = true; 1025 plugin_refresh_allowed_ = true;
1012 1026
(...skipping 12 matching lines...) Expand all
1025 1039
1026 scoped_refptr<base::MessageLoopProxy> 1040 scoped_refptr<base::MessageLoopProxy>
1027 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 1041 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
1028 DCHECK(message_loop() == MessageLoop::current()); 1042 DCHECK(message_loop() == MessageLoop::current());
1029 if (!file_thread_.get()) { 1043 if (!file_thread_.get()) {
1030 file_thread_.reset(new base::Thread("Renderer::FILE")); 1044 file_thread_.reset(new base::Thread("Renderer::FILE"));
1031 file_thread_->Start(); 1045 file_thread_->Start();
1032 } 1046 }
1033 return file_thread_->message_loop_proxy(); 1047 return file_thread_->message_loop_proxy();
1034 } 1048 }
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698