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

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

Issue 1461693003: [headless] Initial skeleton of headless/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded semicolons Created 5 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "headless/public/headless_export.h"
12
13 namespace base {
14 class SingleThreadTaskRunner;
15
16 namespace trace_event {
Sami 2015/11/19 15:42:44 nit: remove
altimin 2015/11/19 16:13:13 Done.
17 class TraceConfig;
18 }
19 }
20
21 namespace gfx {
22 class Size;
23 }
24
25 namespace headless {
26 class WebContents;
27
28 class HEADLESS_EXPORT HeadlessBrowser {
29 public:
30 static HeadlessBrowser* Get();
31
32 // Create a new browser tab.
33 virtual scoped_ptr<WebContents> CreateWebContents(const gfx::Size& size) = 0;
34
35 virtual scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread() = 0;
36 virtual scoped_refptr<base::SingleThreadTaskRunner>
37 renderer_main_thread() = 0;
38
39 // Main routine for running browser.
40 // Should be called from main in the following manner:
41 // int main(int argc, const char** argv) {
42 // return headless::HeadlessBrowser::Get()->Run(argc, argv);
43 // }
44 virtual int Run(int argc, const char** argv) = 0;
45
46 // Requests browser to stop as soon as possible.
47 virtual void Stop() = 0;
48
49 // Registers a callback to be executed on browser main thread
50 // as soon as browser starts.
51 virtual void OnStart(const base::Closure& on_start_callback) = 0;
52
53 protected:
54 virtual ~HeadlessBrowser() {}
55 };
56
57 } // namespace headless
58
59 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_
OLDNEW
« no previous file with comments | « headless/DEPS ('k') | headless/public/headless_export.h » ('j') | headless/public/web_contents.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698