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 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "net/socket/stream_listen_socket.h" | 13 #include "net/socket/stream_listen_socket.h" |
14 | 14 |
15 class GURL; | |
16 | |
17 namespace content { | 15 namespace content { |
18 | 16 |
19 class DevToolsTarget; | 17 class DevToolsTarget; |
20 | 18 |
21 class DevToolsHttpHandlerDelegate { | 19 class DevToolsHttpHandlerDelegate { |
22 public: | 20 public: |
23 virtual ~DevToolsHttpHandlerDelegate() {} | 21 virtual ~DevToolsHttpHandlerDelegate() {} |
24 | 22 |
25 // Should return discovery page HTML that should list available tabs | 23 // Should return discovery page HTML that should list available tabs |
26 // and provide attach links. | 24 // and provide attach links. |
27 virtual std::string GetDiscoveryPageHTML() = 0; | 25 virtual std::string GetDiscoveryPageHTML() = 0; |
28 | 26 |
29 // Returns true if and only if frontend resources are bundled. | 27 // Returns true if and only if frontend resources are bundled. |
30 virtual bool BundlesFrontendResources() = 0; | 28 virtual bool BundlesFrontendResources() = 0; |
31 | 29 |
32 // Returns path to the front-end files on the local filesystem for debugging. | 30 // Returns path to the front-end files on the local filesystem for debugging. |
33 virtual base::FilePath GetDebugFrontendDir() = 0; | 31 virtual base::FilePath GetDebugFrontendDir() = 0; |
34 | 32 |
35 // Get a thumbnail for a given page. Returns non-empty string iff we have the | |
36 // thumbnail. | |
37 virtual std::string GetPageThumbnailData(const GURL& url) = 0; | |
38 | |
39 // Creates new inspectable target. | |
40 virtual scoped_ptr<DevToolsTarget> CreateNewTarget(const GURL& url) = 0; | |
41 | |
42 typedef std::vector<DevToolsTarget*> TargetList; | |
43 typedef base::Callback<void(const TargetList&)> TargetCallback; | |
44 | |
45 // Requests the list of all inspectable targets. | |
46 // The caller gets the ownership of the returned targets. | |
47 virtual void EnumerateTargets(TargetCallback callback) = 0; | |
48 | |
49 // Creates named socket for reversed tethering implementation (used with | 33 // Creates named socket for reversed tethering implementation (used with |
50 // remote debugging, primarily for mobile). | 34 // remote debugging, primarily for mobile). |
51 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( | 35 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( |
52 net::StreamListenSocket::Delegate* delegate, | 36 net::StreamListenSocket::Delegate* delegate, |
53 std::string* name) = 0; | 37 std::string* name) = 0; |
54 }; | 38 }; |
55 | 39 |
56 } // namespace content | 40 } // namespace content |
57 | 41 |
58 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ | 42 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
OLD | NEW |