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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_CLIENT_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_CLIENT_HOST_H_ 7 8 #include <string> 9 10 #include "base/basictypes.h" 11 #include "content/common/content_export.h" 12 13 namespace IPC { 14 class Message; 15 } 16 17 namespace content { 18 19 class RenderViewHost; 20 class WebContents; 21 22 class DevToolsFrontendHostDelegate; 23 24 // Describes interface for managing devtools clients from browser process. There 25 // are currently two types of clients: devtools windows and TCP socket 26 // debuggers. 27 class CONTENT_EXPORT DevToolsClientHost { 28 public: 29 virtual ~DevToolsClientHost() {} 30 31 // Dispatches given message on the front-end. 32 virtual void DispatchOnInspectorFrontend(const std::string& message) = 0; 33 34 // This method is called when the contents inspected by this devtools client 35 // is closing. 36 virtual void InspectedContentsClosing() = 0; 37 38 // Called to notify client that it has been kicked out by some other client 39 // with greater priority. 40 virtual void ReplacedWithAnotherClient() = 0; 41 42 // Creates a DevToolsClientHost for a WebContents containing the default 43 // DevTools frontend implementation. 44 static DevToolsClientHost* CreateDevToolsFrontendHost( 45 WebContents* client_web_contents, 46 DevToolsFrontendHostDelegate* delegate); 47 48 // Sets up DevToolsClient on the corresponding RenderView. 49 static void SetupDevToolsFrontendClient(RenderViewHost* frontend_rvh); 50 }; 51 52 } // namespace content 53 54 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_CLIENT_HOST_H_ 55