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/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 void RenderFrameDevToolsAgentHost::InnerOnClientAttached() { | 198 void RenderFrameDevToolsAgentHost::InnerOnClientAttached() { |
199 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( | 199 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadRawCookies( |
200 render_frame_host_->GetProcess()->GetID()); | 200 render_frame_host_->GetProcess()->GetID()); |
201 | 201 |
202 #if defined(OS_ANDROID) | 202 #if defined(OS_ANDROID) |
203 power_save_blocker_.reset(static_cast<PowerSaveBlockerImpl*>( | 203 power_save_blocker_.reset(static_cast<PowerSaveBlockerImpl*>( |
204 PowerSaveBlocker::Create( | 204 PowerSaveBlocker::Create( |
205 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 205 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
206 PowerSaveBlocker::kReasonOther, "DevTools").release())); | 206 PowerSaveBlocker::kReasonOther, "DevTools").release())); |
207 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( | 207 power_save_blocker_->InitDisplaySleepBlocker( |
208 render_frame_host_->GetRenderViewHost()); | 208 WebContents::FromRenderFrameHost(render_frame_host_)); |
209 if (rvh->GetView()) { | |
210 power_save_blocker_.get()-> | |
211 InitDisplaySleepBlocker(rvh->GetView()->GetNativeView()); | |
212 } | |
213 #endif | 209 #endif |
214 } | 210 } |
215 | 211 |
216 void RenderFrameDevToolsAgentHost::OnClientDetached() { | 212 void RenderFrameDevToolsAgentHost::OnClientDetached() { |
217 #if defined(OS_ANDROID) | 213 #if defined(OS_ANDROID) |
218 power_save_blocker_.reset(); | 214 power_save_blocker_.reset(); |
219 #endif | 215 #endif |
220 emulation_handler_->Detached(); | 216 emulation_handler_->Detached(); |
221 page_handler_->Detached(); | 217 page_handler_->Detached(); |
222 power_handler_->Detached(); | 218 power_handler_->Detached(); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 if (!IsAttached() || !render_frame_host_) | 532 if (!IsAttached() || !render_frame_host_) |
537 return; | 533 return; |
538 ProcessChunkedMessageFromAgent(message); | 534 ProcessChunkedMessageFromAgent(message); |
539 } | 535 } |
540 | 536 |
541 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 537 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
542 return render_frame_host_ && render_frame_host_->GetParent(); | 538 return render_frame_host_ && render_frame_host_->GetParent(); |
543 } | 539 } |
544 | 540 |
545 } // namespace content | 541 } // namespace content |
OLD | NEW |