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

Unified Diff: headless/lib/browser/headless_web_contents_impl.h

Issue 2896763002: Implement window management devtools commands for headless. (Closed)
Patch Set: map 1 tab to 1 window and remove screen_size 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 side-by-side diff with in-line comments
Download patch
Index: headless/lib/browser/headless_web_contents_impl.h
diff --git a/headless/lib/browser/headless_web_contents_impl.h b/headless/lib/browser/headless_web_contents_impl.h
index 93edc99d60de7d77285d06627ac7450f56c3ff65..2f6c710d6510839fb5007e5fcb6d2eb138d35df7 100644
--- a/headless/lib/browser/headless_web_contents_impl.h
+++ b/headless/lib/browser/headless_web_contents_impl.h
@@ -100,6 +100,13 @@ class HEADLESS_EXPORT HeadlessWebContentsImpl
HeadlessWindowTreeHost* window_tree_host() const {
return window_tree_host_.get();
}
+ int window_id() const { return window_id_; }
+ void set_window_state(const std::string& state) {
+ DCHECK(state == "normal" || state == "minimized" || state == "maximized" ||
+ state == "fullscreen");
+ window_state_ = state;
+ }
+ std::string window_state() const { return window_state_; }
Sami 2017/05/24 17:50:54 nit: return const ref
jzfeng 2017/05/25 01:10:50 Done.
private:
// Takes ownership of |web_contents|.
@@ -112,6 +119,8 @@ class HEADLESS_EXPORT HeadlessWebContentsImpl
class Delegate;
std::unique_ptr<Delegate> web_contents_delegate_;
std::unique_ptr<HeadlessWindowTreeHost> window_tree_host_;
+ int window_id_;
Sami 2017/05/24 17:50:54 Please zero-initialize this here or in the constru
jzfeng 2017/05/25 01:10:50 Done.
+ std::string window_state_;
std::unique_ptr<content::WebContents> web_contents_;
scoped_refptr<content::DevToolsAgentHost> agent_host_;
std::list<MojoService> mojo_services_;

Powered by Google App Engine
This is Rietveld 408576698