Roll src/third_party/skia 2440fcd:4de8c3a
[chromium-blink-merge.git] / content / shell / browser / shell_browser_main_parts.h
blob5dc117e2ccbb92976f02348a175437d7b226ee63
1 // Copyright 2013 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.
5 #ifndef CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/browser_main_parts.h"
11 #include "content/public/common/main_function_params.h"
12 #include "content/shell/browser/shell_browser_context.h"
14 #if defined(OS_ANDROID)
15 namespace breakpad {
16 class CrashDumpManager;
18 #endif
20 namespace base {
21 class Thread;
24 namespace devtools_http_handler {
25 class DevToolsHttpHandler;
28 namespace net {
29 class NetLog;
32 namespace content {
34 class ShellBrowserMainParts : public BrowserMainParts {
35 public:
36 explicit ShellBrowserMainParts(const MainFunctionParams& parameters);
37 ~ShellBrowserMainParts() override;
39 // BrowserMainParts overrides.
40 void PreEarlyInitialization() override;
41 void PreMainMessageLoopStart() override;
42 void PostMainMessageLoopStart() override;
43 void PreMainMessageLoopRun() override;
44 bool MainMessageLoopRun(int* result_code) override;
45 void PostMainMessageLoopRun() override;
47 devtools_http_handler::DevToolsHttpHandler* devtools_http_handler() {
48 return devtools_http_handler_.get();
51 ShellBrowserContext* browser_context() { return browser_context_.get(); }
52 ShellBrowserContext* off_the_record_browser_context() {
53 return off_the_record_browser_context_.get();
56 net::NetLog* net_log() { return net_log_.get(); }
58 protected:
59 virtual void InitializeBrowserContexts();
60 virtual void InitializeMessageLoopContext();
62 void set_browser_context(ShellBrowserContext* context) {
63 browser_context_.reset(context);
65 void set_off_the_record_browser_context(ShellBrowserContext* context) {
66 off_the_record_browser_context_.reset(context);
69 private:
70 #if defined(OS_ANDROID)
71 scoped_ptr<breakpad::CrashDumpManager> crash_dump_manager_;
72 #endif
73 scoped_ptr<net::NetLog> net_log_;
74 scoped_ptr<ShellBrowserContext> browser_context_;
75 scoped_ptr<ShellBrowserContext> off_the_record_browser_context_;
77 // For running content_browsertests.
78 const MainFunctionParams parameters_;
79 bool run_message_loop_;
81 scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;
83 DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts);
86 } // namespace content
88 #endif // CONTENT_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_