shell_browser_main_parts.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
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 net {
22class NetLog;
23}
24
25namespace views {
26namespace corewm {
27class WMState;
28}
29}
30
31namespace ash {
32namespace shell {
33
34class ShellDelegateImpl;
35class WindowWatcher;
36
37class ShellBrowserMainParts : public content::BrowserMainParts {
38 public:
39  explicit ShellBrowserMainParts(
40      const content::MainFunctionParams& parameters);
41  virtual ~ShellBrowserMainParts();
42
43  // Overridden from content::BrowserMainParts:
44  virtual void PreMainMessageLoopStart() OVERRIDE;
45  virtual void PostMainMessageLoopStart() OVERRIDE;
46  virtual void ToolkitInitialized() OVERRIDE;
47  virtual void PreMainMessageLoopRun() OVERRIDE;
48  virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
49  virtual void PostMainMessageLoopRun() OVERRIDE;
50
51  content::ShellBrowserContext* browser_context() {
52    return browser_context_.get();
53  }
54
55 private:
56  scoped_ptr<net::NetLog> net_log_;
57  scoped_ptr<content::ShellBrowserContext> browser_context_;
58  scoped_ptr<ash::shell::WindowWatcher> window_watcher_;
59  ShellDelegateImpl* delegate_;  // owned by Shell
60  scoped_ptr<views::corewm::WMState> wm_state_;
61
62  DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts);
63};
64
65}  // namespace shell
66}  // namespace ash
67
68#endif  // ASH_SHELL_CONTENT_CLIENT_EXAMPLES_BROWSER_MAIN_PARTS_H_
69