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

Side by Side Diff: headless/app/headless_shell.h

Issue 2677033003: headless: Add a small C++ example application (Closed)
Patch Set: Rebased Created 3 years, 10 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_example.cc ('k') | headless/app/headless_shell.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 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 #include "base/files/file_proxy.h" 5 #include "base/files/file_proxy.h"
6 #include "base/memory/weak_ptr.h" 6 #include "base/memory/weak_ptr.h"
7 #include "headless/app/shell_navigation_request.h" 7 #include "headless/app/shell_navigation_request.h"
8 #include "headless/public/devtools/domains/emulation.h" 8 #include "headless/public/devtools/domains/emulation.h"
9 #include "headless/public/devtools/domains/inspector.h" 9 #include "headless/public/devtools/domains/inspector.h"
10 #include "headless/public/devtools/domains/page.h" 10 #include "headless/public/devtools/domains/page.h"
11 #include "headless/public/devtools/domains/runtime.h" 11 #include "headless/public/devtools/domains/runtime.h"
12 #include "headless/public/headless_browser.h" 12 #include "headless/public/headless_browser.h"
13 #include "headless/public/headless_devtools_client.h" 13 #include "headless/public/headless_devtools_client.h"
14 #include "headless/public/headless_web_contents.h" 14 #include "headless/public/headless_web_contents.h"
15 #include "headless/public/util/deterministic_dispatcher.h" 15 #include "headless/public/util/deterministic_dispatcher.h"
16 #include "net/base/file_stream.h" 16 #include "net/base/file_stream.h"
17 17
18 namespace headless { 18 namespace headless {
19 19
20 // An application which implements a simple headless browser. 20 // An application which implements a simple headless browser.
21 class HeadlessShell : public HeadlessWebContents::Observer, 21 class HeadlessShell : public HeadlessWebContents::Observer,
22 emulation::ExperimentalObserver, 22 public emulation::ExperimentalObserver,
23 inspector::ExperimentalObserver, 23 public inspector::ExperimentalObserver,
24 page::ExperimentalObserver { 24 public page::ExperimentalObserver {
25 public: 25 public:
26 HeadlessShell(); 26 HeadlessShell();
27 ~HeadlessShell() override; 27 ~HeadlessShell() override;
28 28
29 // HeadlessWebContents::Observer implementation: 29 // HeadlessWebContents::Observer implementation:
30 void DevToolsTargetReady() override; 30 void DevToolsTargetReady() override;
31 void OnTargetCrashed(const inspector::TargetCrashedParams& params) override; 31 void OnTargetCrashed(const inspector::TargetCrashedParams& params) override;
32 32
33 // emulation::Observer implementation: 33 // emulation::Observer implementation:
34 void OnVirtualTimeBudgetExpired( 34 void OnVirtualTimeBudgetExpired(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool processed_page_ready_; 89 bool processed_page_ready_;
90 std::unique_ptr<base::FileProxy> screenshot_file_proxy_; 90 std::unique_ptr<base::FileProxy> screenshot_file_proxy_;
91 HeadlessBrowserContext* browser_context_; 91 HeadlessBrowserContext* browser_context_;
92 std::unique_ptr<DeterministicDispatcher> deterministic_dispatcher_; 92 std::unique_ptr<DeterministicDispatcher> deterministic_dispatcher_;
93 base::WeakPtrFactory<HeadlessShell> weak_factory_; 93 base::WeakPtrFactory<HeadlessShell> weak_factory_;
94 94
95 DISALLOW_COPY_AND_ASSIGN(HeadlessShell); 95 DISALLOW_COPY_AND_ASSIGN(HeadlessShell);
96 }; 96 };
97 97
98 } // namespace headless 98 } // namespace headless
OLDNEW
« no previous file with comments | « headless/app/headless_example.cc ('k') | headless/app/headless_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698