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