summaryrefslogtreecommitdiffstats
path: root/components/devtools_http_handler/devtools_http_handler_delegate.h
blob: cf4b9db7c74ebfcaca050e954585189b88b7bd8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_DEVTOOLS_HTTP_HANDLER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_
#define COMPONENTS_DEVTOOLS_HTTP_HANDLER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_

#include <string>

#include "url/gurl.h"

namespace content {
class DevToolsExternalAgentProxyDelegate;
}

namespace devtools_http_handler {

class DevToolsHttpHandlerDelegate {
 public:
  virtual ~DevToolsHttpHandlerDelegate() {}

  // Should return discovery page HTML that should list available tabs
  // and provide attach links.
  virtual std::string GetDiscoveryPageHTML() = 0;

  // Returns frontend resource data by |path|. Only used if
  // |BundlesFrontendResources| returns |true|.
  virtual std::string GetFrontendResource(const std::string& path) = 0;

  // Get a thumbnail for a given page. Returns non-empty string iff we have the
  // thumbnail.
  virtual std::string GetPageThumbnailData(const GURL& url) = 0;

  // Allows embedder to handle custom websocket-based protocol connection
  // pointing remote debugging port. Returns ownership.
  virtual content::DevToolsExternalAgentProxyDelegate*
      HandleWebSocketConnection(const std::string& path) = 0;
};

}  // namespace devtools_http_handler

#endif  // COMPONENTS_DEVTOOLS_HTTP_HANDLER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_