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/browser/devtools/render_frame_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // extensions::ProcessManager no longer relies on this notification. | 204 // extensions::ProcessManager no longer relies on this notification. |
205 if (!reattaching_) | 205 if (!reattaching_) |
206 DevToolsAgentHostImpl::NotifyCallbacks(this, true); | 206 DevToolsAgentHostImpl::NotifyCallbacks(this, true); |
207 } | 207 } |
208 | 208 |
209 void RenderFrameDevToolsAgentHost::InnerOnClientAttached() { | 209 void RenderFrameDevToolsAgentHost::InnerOnClientAttached() { |
210 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( | 210 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( |
211 render_frame_host_->GetProcess()->GetID()); | 211 render_frame_host_->GetProcess()->GetID()); |
212 | 212 |
213 #if defined(OS_ANDROID) | 213 #if defined(OS_ANDROID) |
214 power_save_blocker_.reset( | 214 power_save_blocker_.reset(static_cast<PowerSaveBlockerImpl*>( |
215 static_cast<PowerSaveBlockerImpl*>( | 215 PowerSaveBlocker::Create( |
216 PowerSaveBlocker::Create( | 216 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
217 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 217 PowerSaveBlocker::kReasonOther, "DevTools").release())); |
218 "DevTools").release())); | |
219 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | 218 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
220 render_frame_host_->GetRenderViewHost()); | 219 render_frame_host_->GetRenderViewHost()); |
221 if (rvh->GetView()) { | 220 if (rvh->GetView()) { |
222 power_save_blocker_.get()-> | 221 power_save_blocker_.get()-> |
223 InitDisplaySleepBlocker(rvh->GetView()->GetNativeView()); | 222 InitDisplaySleepBlocker(rvh->GetView()->GetNativeView()); |
224 } | 223 } |
225 #endif | 224 #endif |
226 } | 225 } |
227 | 226 |
228 void RenderFrameDevToolsAgentHost::OnClientDetached() { | 227 void RenderFrameDevToolsAgentHost::OnClientDetached() { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 523 } |
525 | 524 |
526 void RenderFrameDevToolsAgentHost::DispatchOnInspectorFrontend( | 525 void RenderFrameDevToolsAgentHost::DispatchOnInspectorFrontend( |
527 const std::string& message) { | 526 const std::string& message) { |
528 if (!IsAttached() || !render_frame_host_) | 527 if (!IsAttached() || !render_frame_host_) |
529 return; | 528 return; |
530 SendMessageToClient(message); | 529 SendMessageToClient(message); |
531 } | 530 } |
532 | 531 |
533 } // namespace content | 532 } // namespace content |
OLD | NEW |