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

Side by Side Diff: headless/lib/browser/headless_web_contents_impl.h

Issue 2896763002: Implement window management devtools commands for headless. (Closed)
Patch Set: nit Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 HeadlessWindowTreeHost* window_tree_host() const { 100 HeadlessWindowTreeHost* window_tree_host() const {
101 return window_tree_host_.get(); 101 return window_tree_host_.get();
102 } 102 }
103 103
104 private: 104 private:
105 // Takes ownership of |web_contents|. 105 // Takes ownership of |web_contents|.
106 HeadlessWebContentsImpl(content::WebContents* web_contents, 106 HeadlessWebContentsImpl(content::WebContents* web_contents,
107 HeadlessBrowserContextImpl* browser_context); 107 HeadlessBrowserContextImpl* browser_context);
108 108
109 void InitializeScreen(const gfx::Size& initial_size); 109 void InitializeScreen(const gfx::Size& initial_window_size,
110 const gfx::Size& screen_size);
110 using MojoService = HeadlessWebContents::Builder::MojoService; 111 using MojoService = HeadlessWebContents::Builder::MojoService;
111 112
112 class Delegate; 113 class Delegate;
113 std::unique_ptr<Delegate> web_contents_delegate_; 114 std::unique_ptr<Delegate> web_contents_delegate_;
114 std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_; 115 std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_;
115 std::unique_ptr<content::WebContents> web_contents_; 116 std::unique_ptr<content::WebContents> web_contents_;
116 scoped_refptr<content::DevToolsAgentHost> agent_host_; 117 scoped_refptr<content::DevToolsAgentHost> agent_host_;
117 std::list<MojoService> mojo_services_; 118 std::list<MojoService> mojo_services_;
118 std::unique_ptr<HeadlessTabSocketImpl> headless_tab_socket_; 119 std::unique_ptr<HeadlessTabSocketImpl> headless_tab_socket_;
119 120
120 HeadlessBrowserContextImpl* browser_context_; // Not owned. 121 HeadlessBrowserContextImpl* browser_context_; // Not owned.
121 // TODO(alexclarke): With OOPIF there may be more than one renderer, we need 122 // TODO(alexclarke): With OOPIF there may be more than one renderer, we need
122 // to fix this. See crbug.com/715924 123 // to fix this. See crbug.com/715924
123 content::RenderProcessHost* render_process_host_; // Not owned. 124 content::RenderProcessHost* render_process_host_; // Not owned.
124 125
125 using ObserverMap = 126 using ObserverMap =
126 std::unordered_map<HeadlessWebContents::Observer*, 127 std::unordered_map<HeadlessWebContents::Observer*,
127 std::unique_ptr<WebContentsObserverAdapter>>; 128 std::unique_ptr<WebContentsObserverAdapter>>;
128 ObserverMap observer_map_; 129 ObserverMap observer_map_;
129 130
130 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl); 131 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl);
131 }; 132 };
132 133
133 } // namespace headless 134 } // namespace headless
134 135
135 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ 136 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698