1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/devtools/protocol/inspector_handler.h"
7 #include "content/browser/frame_host/render_frame_host_impl.h"
13 using Response
= DevToolsProtocolClient::Response
;
15 InspectorHandler::InspectorHandler()
19 InspectorHandler::~InspectorHandler() {
22 void InspectorHandler::SetClient(scoped_ptr
<Client
> client
) {
26 void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl
* host
) {
30 void InspectorHandler::TargetCrashed() {
31 client_
->TargetCrashed(TargetCrashedParams::Create());
34 void InspectorHandler::TargetDetached(const std::string
& reason
) {
35 client_
->Detached(DetachedParams::Create()->set_reason(reason
));
38 Response
InspectorHandler::Enable() {
39 if (host_
&& !host_
->IsRenderFrameLive())
40 client_
->TargetCrashed(TargetCrashedParams::Create());
41 return Response::FallThrough();
45 } // namespace inspector
46 } // namespace devtools
47 } // namespace content