Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: content/shell/browser/shell_devtools_bindings.h

Issue 2837083003: DevTools: create test infrastructure so devtools drives the test (Closed)
Patch Set: all Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ 6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 ~ShellDevToolsBindings() override; 54 ~ShellDevToolsBindings() override;
55 55
56 protected: 56 protected:
57 // content::DevToolsAgentHostClient implementation. 57 // content::DevToolsAgentHostClient implementation.
58 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; 58 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override;
59 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, 59 void DispatchProtocolMessage(DevToolsAgentHost* agent_host,
60 const std::string& message) override; 60 const std::string& message) override;
61 61
62 void SetPreferences(const std::string& json); 62 void SetPreferences(const std::string& json);
63 virtual void HandleMessageFromDevToolsFrontend(const std::string& message); 63 virtual void HandleMessageFromDevToolsFrontend(const std::string& message);
64 void CreateFrontendHost();
65 64
66 private: 65 private:
67 // WebContentsObserver overrides 66 // WebContentsObserver overrides
68 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; 67 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override;
69 void RenderViewCreated(RenderViewHost* render_view_host) override;
70 void DocumentAvailableInMainFrame() override; 68 void DocumentAvailableInMainFrame() override;
71 void WebContentsDestroyed() override; 69 void WebContentsDestroyed() override;
72 70
73 // net::URLFetcherDelegate overrides. 71 // net::URLFetcherDelegate overrides.
74 void OnURLFetchComplete(const net::URLFetcher* source) override; 72 void OnURLFetchComplete(const net::URLFetcher* source) override;
75 73
74 void CreateFrontendHost(RenderFrameHost* render_frame_host);
dgozman 2017/06/19 22:55:51 remove
chenwilliam 2017/06/19 23:48:17 Done.
76 void SendMessageAck(int request_id, const base::Value* arg1); 75 void SendMessageAck(int request_id, const base::Value* arg1);
77 76
78 WebContents* inspected_contents_; 77 WebContents* inspected_contents_;
79 ShellDevToolsDelegate* delegate_; 78 ShellDevToolsDelegate* delegate_;
80 scoped_refptr<DevToolsAgentHost> agent_host_; 79 scoped_refptr<DevToolsAgentHost> agent_host_;
81 int inspect_element_at_x_; 80 int inspect_element_at_x_;
82 int inspect_element_at_y_; 81 int inspect_element_at_y_;
83 #if !defined(OS_ANDROID) 82 #if !defined(OS_ANDROID)
84 std::unique_ptr<DevToolsFrontendHost> frontend_host_; 83 std::unique_ptr<DevToolsFrontendHost> frontend_host_;
85 #endif 84 #endif
86 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; 85 using PendingRequestsMap = std::map<const net::URLFetcher*, int>;
87 PendingRequestsMap pending_requests_; 86 PendingRequestsMap pending_requests_;
88 base::DictionaryValue preferences_; 87 base::DictionaryValue preferences_;
89 using ExtensionsAPIs = std::map<std::string, std::string>; 88 using ExtensionsAPIs = std::map<std::string, std::string>;
90 ExtensionsAPIs extensions_api_; 89 ExtensionsAPIs extensions_api_;
91 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; 90 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_;
92 91
93 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); 92 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings);
94 }; 93 };
95 94
96 } // namespace content 95 } // namespace content
97 96
98 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ 97 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698