- add sources.
[platform/framework/web/crosswalk.git] / src / apps / shell / app_shell_browser_main_parts.h
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.
4
5 #ifndef APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_
6 #define APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/browser_main_parts.h"
12
13 namespace content {
14 class ShellBrowserContext;
15 struct MainFunctionParams;
16 }
17
18 namespace shell {
19 class MinimalShell;
20 }
21
22 namespace views {
23 class ViewsDelegate;
24 }
25
26 namespace apps {
27
28 // Handles initialization of AppShell.
29 class AppShellBrowserMainParts : public content::BrowserMainParts {
30  public:
31   explicit AppShellBrowserMainParts(
32       const content::MainFunctionParams& parameters);
33   virtual ~AppShellBrowserMainParts();
34
35   // BrowserMainParts overrides.
36   virtual void PreEarlyInitialization() OVERRIDE;
37   virtual void PreMainMessageLoopStart() OVERRIDE;
38   virtual void PostMainMessageLoopStart() OVERRIDE;
39   virtual void PreMainMessageLoopRun() OVERRIDE;
40   virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
41   virtual void PostMainMessageLoopRun() OVERRIDE;
42
43   content::ShellBrowserContext* browser_context() {
44     return browser_context_.get();
45   }
46
47  private:
48   scoped_ptr<content::ShellBrowserContext> browser_context_;
49
50   // Enable a minimal set of views::corewm to be initialized.
51   scoped_ptr<shell::MinimalShell> minimal_shell_;
52
53   DISALLOW_COPY_AND_ASSIGN(AppShellBrowserMainParts);
54 };
55
56 }  // namespace apps
57
58 #endif  // APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_