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/ref_counted.h" | |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "content/public/browser/devtools_agent_host.h" | |
15 #include "content/public/browser/devtools_target.h" | |
13 #include "net/socket/stream_listen_socket.h" | 16 #include "net/socket/stream_listen_socket.h" |
14 | 17 |
15 class GURL; | 18 class GURL; |
16 | 19 |
17 namespace content { | 20 namespace content { |
18 | 21 |
19 class RenderViewHost; | 22 class DevToolsHttpHandlerDelegate |
20 | 23 : public base::RefCountedThreadSafe<DevToolsHttpHandlerDelegate> { |
pfeldman
2013/10/01 14:10:24
Could we keep it raw?
Vladislav Kaznacheev
2013/10/01 15:00:16
Done.
| |
21 class DevToolsHttpHandlerDelegate { | |
22 public: | 24 public: |
23 enum TargetType { | 25 typedef std::vector<scoped_refptr<DevToolsTarget> > TargetList; |
24 kTargetTypeTab = 0, | 26 typedef base::Callback<void(const TargetList&)> TargetCallback; |
25 kTargetTypeOther, | |
26 }; | |
27 | |
28 virtual ~DevToolsHttpHandlerDelegate() {} | |
29 | 27 |
30 // Should return discovery page HTML that should list available tabs | 28 // Should return discovery page HTML that should list available tabs |
31 // and provide attach links. | 29 // and provide attach links. |
32 virtual std::string GetDiscoveryPageHTML() = 0; | 30 virtual std::string GetDiscoveryPageHTML() = 0; |
33 | 31 |
34 // Returns true if and only if frontend resources are bundled. | 32 // Returns true if and only if frontend resources are bundled. |
35 virtual bool BundlesFrontendResources() = 0; | 33 virtual bool BundlesFrontendResources() = 0; |
36 | 34 |
37 // Returns path to the front-end files on the local filesystem for debugging. | 35 // Returns path to the front-end files on the local filesystem for debugging. |
38 virtual base::FilePath GetDebugFrontendDir() = 0; | 36 virtual base::FilePath GetDebugFrontendDir() = 0; |
39 | 37 |
40 // Get a thumbnail for a given page. Returns non-empty string iff we have the | 38 // Get a thumbnail for a given page. Returns non-empty string iff we have the |
41 // thumbnail. | 39 // thumbnail. |
42 virtual std::string GetPageThumbnailData(const GURL& url) = 0; | 40 virtual std::string GetPageThumbnailData(const GURL& url) = 0; |
43 | 41 |
44 // Creates new inspectable target and returns its render view host. | 42 // Creates new inspectable target. |
45 virtual RenderViewHost* CreateNewTarget() = 0; | 43 virtual scoped_refptr<DevToolsTarget> CreateNewTarget() = 0; |
46 | 44 |
47 // Returns the type of the target. | 45 // Requests the list of all inspectable targets. |
48 virtual TargetType GetTargetType(RenderViewHost*) = 0; | 46 virtual void EnumerateTargets(TargetCallback callback) = 0; |
49 | |
50 // Provides the delegate with an ability to supply a description for views. | |
51 virtual std::string GetViewDescription(content::RenderViewHost*) = 0; | |
52 | 47 |
53 // Creates named socket for reversed tethering implementation (used with | 48 // Creates named socket for reversed tethering implementation (used with |
54 // remote debugging, primarily for mobile). | 49 // remote debugging, primarily for mobile). |
55 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( | 50 virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( |
56 net::StreamListenSocket::Delegate* delegate, | 51 net::StreamListenSocket::Delegate* delegate, |
57 std::string* name) = 0; | 52 std::string* name) = 0; |
53 | |
54 protected: | |
55 friend class base::RefCountedThreadSafe<DevToolsHttpHandlerDelegate>; | |
56 | |
57 virtual ~DevToolsHttpHandlerDelegate() {} | |
58 }; | 58 }; |
59 | 59 |
60 } // namespace content | 60 } // namespace content |
61 | 61 |
62 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ | 62 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_DELEGATE_H_ |
OLD | NEW |