shell_browser_main_parts.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 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 ASH_SHELL_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
6#define ASH_SHELL_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
7
8#include "base/basictypes.h"
9#include "base/memory/scoped_ptr.h"
10#include "content/public/browser/browser_main_parts.h"
11
12namespace base {
13class Thread;
14}
15
16namespace content {
17class ShellBrowserContext;
18struct MainFunctionParams;
19}
20
21namespace ash {
22namespace shell {
23
24class WindowWatcher;
25
26class ShellBrowserMainParts : public content::BrowserMainParts {
27 public:
28  explicit ShellBrowserMainParts(
29      const content::MainFunctionParams& parameters);
30  virtual ~ShellBrowserMainParts();
31
32  // Overridden from content::BrowserMainParts:
33  virtual void PreMainMessageLoopStart() OVERRIDE;
34  virtual void PostMainMessageLoopStart() OVERRIDE;
35  virtual void PreMainMessageLoopRun() OVERRIDE;
36  virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
37  virtual void PostMainMessageLoopRun() OVERRIDE;
38
39  content::ShellBrowserContext* browser_context() {
40    return browser_context_.get();
41  }
42
43 private:
44  scoped_ptr<content::ShellBrowserContext> browser_context_;
45  scoped_ptr<ash::shell::WindowWatcher> window_watcher_;
46
47  DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts);
48};
49
50}  // namespace shell
51}  // namespace ash
52
53#endif  // ASH_SHELL_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
54