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

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: Pure virtual indeed 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
17 namespace gfx {
18 class Size;
19 }
20
21 namespace headless {
22 class WebContents;
23
24 class HEADLESS_EXPORT HeadlessBrowser {
25 public:
26 static HeadlessBrowser* Get();
27
28 // Create a new browser tab.
29 virtual scoped_ptr<WebContents> CreateWebContents(const gfx::Size& size) = 0;
alex clarke (OOO till 29th) 2015/11/19 18:17:54 Is the idea that inside of the closure passed to R
altimin 2015/11/19 18:36:24 That's one of the uses, yes, but it's not the only
30
31 virtual scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread() = 0;
32 virtual scoped_refptr<base::SingleThreadTaskRunner>
33 renderer_main_thread() = 0;
34
35 // Main routine for running browser.
36 // Takes command line args and callback to run as soon as browser starts.
37 // Should be called from main in the following manner:
38 // int main(int argc, const char** argv) {
39 // return headless::HeadlessBrowser::Get()->Run(
40 // argc, argv, base::Bind(function_to_be_run_on_browser_start));
41 // }
42 virtual int Run(
43 int argc,
44 const char** argv,
45 const base::Closure& on_browser_start_callback) = 0;
46
47 // Requests browser to stop as soon as possible.
48 virtual void Stop() = 0;
49
50 protected:
51 virtual ~HeadlessBrowser() {}
52 };
53
54 } // namespace headless
55
56 #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