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

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

Issue 2035733002: headless: Implement screenshot capturing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses reviewer comments. Created 4 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
« no previous file with comments | « headless/app/headless_shell_switches.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | 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_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
7 7
8 #include "headless/public/headless_browser.h" 8 #include "headless/public/headless_browser.h"
9 9
10 #include <memory> 10 #include <memory>
11 #include <unordered_map> 11 #include <unordered_map>
12 #include <vector>
12 13
13 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
14 #include "headless/lib/browser/headless_web_contents_impl.h" 15 #include "headless/lib/browser/headless_web_contents_impl.h"
15 16
16 namespace aura { 17 namespace aura {
17 class WindowTreeHost; 18 class WindowTreeHost;
18 19
19 namespace client { 20 namespace client {
20 class WindowTreeClient; 21 class WindowTreeClient;
21 } 22 }
22 } 23 }
23 24
24 namespace headless { 25 namespace headless {
25 26
26 class HeadlessBrowserContext; 27 class HeadlessBrowserContext;
27 class HeadlessBrowserMainParts; 28 class HeadlessBrowserMainParts;
28 29
29 class HeadlessBrowserImpl : public HeadlessBrowser { 30 class HeadlessBrowserImpl : public HeadlessBrowser {
30 public: 31 public:
31 HeadlessBrowserImpl( 32 HeadlessBrowserImpl(
32 const base::Callback<void(HeadlessBrowser*)>& on_start_callback, 33 const base::Callback<void(HeadlessBrowser*)>& on_start_callback,
33 HeadlessBrowser::Options options); 34 HeadlessBrowser::Options options);
34 ~HeadlessBrowserImpl() override; 35 ~HeadlessBrowserImpl() override;
35 36
36 // HeadlessBrowser implementation: 37 // HeadlessBrowser implementation:
37 HeadlessWebContents* CreateWebContents(const GURL& initial_url, 38 HeadlessWebContents* CreateWebContents(const GURL& initial_url,
38 const gfx::Size& size) override; 39 const gfx::Size& size) override;
39 scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() 40 scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread()
40 const override; 41 const override;
42 scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread()
43 const override;
41 44
42 void Shutdown() override; 45 void Shutdown() override;
43 46
44 std::vector<HeadlessWebContents*> GetAllWebContents() override; 47 std::vector<HeadlessWebContents*> GetAllWebContents() override;
45 48
46 void set_browser_main_parts(HeadlessBrowserMainParts* browser_main_parts); 49 void set_browser_main_parts(HeadlessBrowserMainParts* browser_main_parts);
47 HeadlessBrowserMainParts* browser_main_parts() const; 50 HeadlessBrowserMainParts* browser_main_parts() const;
48 51
49 HeadlessBrowserContext* browser_context() const; 52 HeadlessBrowserContext* browser_context() const;
50 53
(...skipping 15 matching lines...) Expand all
66 protected: 69 protected:
67 base::Callback<void(HeadlessBrowser*)> on_start_callback_; 70 base::Callback<void(HeadlessBrowser*)> on_start_callback_;
68 HeadlessBrowser::Options options_; 71 HeadlessBrowser::Options options_;
69 HeadlessBrowserMainParts* browser_main_parts_; // Not owned. 72 HeadlessBrowserMainParts* browser_main_parts_; // Not owned.
70 std::unique_ptr<aura::WindowTreeHost> window_tree_host_; 73 std::unique_ptr<aura::WindowTreeHost> window_tree_host_;
71 std::unique_ptr<aura::client::WindowTreeClient> window_tree_client_; 74 std::unique_ptr<aura::client::WindowTreeClient> window_tree_client_;
72 75
73 std::unordered_map<HeadlessWebContents*, std::unique_ptr<HeadlessWebContents>> 76 std::unordered_map<HeadlessWebContents*, std::unique_ptr<HeadlessWebContents>>
74 web_contents_; 77 web_contents_;
75 78
79 private:
76 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl); 80 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserImpl);
77 }; 81 };
78 82
79 } // namespace headless 83 } // namespace headless
80 84
81 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_ 85 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_IMPL_H_
OLDNEW
« no previous file with comments | « headless/app/headless_shell_switches.cc ('k') | headless/lib/browser/headless_browser_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698