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

Side by Side Diff: headless/public/headless_web_contents.h

Issue 2199773002: headless: make initial screen/window sizes configurable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix constexpr, reference to screen_size in test. Created 4 years, 4 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
« no previous file with comments | « headless/public/headless_browser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 5 #ifndef HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 public: 69 public:
70 ~Builder(); 70 ~Builder();
71 Builder(Builder&&); 71 Builder(Builder&&);
72 72
73 // Set an initial URL to ensure that the renderer gets initialized and 73 // Set an initial URL to ensure that the renderer gets initialized and
74 // eventually becomes ready to be inspected. See 74 // eventually becomes ready to be inspected. See
75 // HeadlessWebContents::Observer::DevToolsTargetReady. The default URL is 75 // HeadlessWebContents::Observer::DevToolsTargetReady. The default URL is
76 // about:blank. 76 // about:blank.
77 Builder& SetInitialURL(const GURL& initial_url); 77 Builder& SetInitialURL(const GURL& initial_url);
78 78
79 // Specify the initial window size (default is 800x600). 79 // Specify the initial window size (default is configured in browser options).
80 Builder& SetWindowSize(const gfx::Size& size); 80 Builder& SetWindowSize(const gfx::Size& size);
81 81
82 // Set a browser context for storing session data (e.g., cookies, cache, local 82 // Set a browser context for storing session data (e.g., cookies, cache, local
83 // storage) for the tab. Several tabs can share the same browser context. If 83 // storage) for the tab. Several tabs can share the same browser context. If
84 // unset, the default browser context will be used. The browser context must 84 // unset, the default browser context will be used. The browser context must
85 // outlive this HeadlessWebContents. 85 // outlive this HeadlessWebContents.
86 Builder& SetBrowserContext(HeadlessBrowserContext* browser_context); 86 Builder& SetBrowserContext(HeadlessBrowserContext* browser_context);
87 87
88 // Specify an embedder provided Mojo service to be installed. The 88 // Specify an embedder provided Mojo service to be installed. The
89 // |service_factory| callback is called on demand by Mojo to instantiate the 89 // |service_factory| callback is called on demand by Mojo to instantiate the
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 base::Callback<void(mojo::ScopedMessagePipeHandle)> service_factory; 128 base::Callback<void(mojo::ScopedMessagePipeHandle)> service_factory;
129 129
130 private: 130 private:
131 DISALLOW_COPY_AND_ASSIGN(MojoService); 131 DISALLOW_COPY_AND_ASSIGN(MojoService);
132 }; 132 };
133 133
134 explicit Builder(HeadlessBrowserImpl* browser); 134 explicit Builder(HeadlessBrowserImpl* browser);
135 135
136 HeadlessBrowserImpl* browser_; 136 HeadlessBrowserImpl* browser_;
137 GURL initial_url_ = GURL("about:blank"); 137 GURL initial_url_ = GURL("about:blank");
138 gfx::Size window_size_ = gfx::Size(800, 600); 138 gfx::Size window_size_;
139 HeadlessBrowserContext* browser_context_; 139 HeadlessBrowserContext* browser_context_;
140 std::list<MojoService> mojo_services_; 140 std::list<MojoService> mojo_services_;
141 141
142 DISALLOW_COPY_AND_ASSIGN(Builder); 142 DISALLOW_COPY_AND_ASSIGN(Builder);
143 }; 143 };
144 144
145 } // namespace headless 145 } // namespace headless
146 146
147 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 147 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
OLDNEW
« no previous file with comments | « headless/public/headless_browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698