| OLD | NEW |
| (Empty) |
| 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 base { | |
| 14 class FilePath; | |
| 15 } | |
| 16 | |
| 17 namespace content { | |
| 18 class ShellBrowserContext; | |
| 19 struct MainFunctionParams; | |
| 20 } | |
| 21 | |
| 22 namespace views { | |
| 23 class ViewsDelegate; | |
| 24 } | |
| 25 | |
| 26 namespace wm { | |
| 27 class WMTestHelper; | |
| 28 } | |
| 29 | |
| 30 namespace apps { | |
| 31 | |
| 32 class AppShellBrowserContext; | |
| 33 class AppShellExtensionsBrowserClient; | |
| 34 | |
| 35 // Handles initialization of AppShell. | |
| 36 class AppShellBrowserMainParts : public content::BrowserMainParts { | |
| 37 public: | |
| 38 explicit AppShellBrowserMainParts( | |
| 39 const content::MainFunctionParams& parameters); | |
| 40 virtual ~AppShellBrowserMainParts(); | |
| 41 | |
| 42 AppShellBrowserContext* browser_context() { | |
| 43 return browser_context_.get(); | |
| 44 } | |
| 45 | |
| 46 // Creates the window that hosts the apps. | |
| 47 void CreateRootWindow(); | |
| 48 | |
| 49 // Launches an application from a directory. | |
| 50 void LoadAndLaunchApp(const base::FilePath& app_dir); | |
| 51 | |
| 52 // BrowserMainParts overrides. | |
| 53 virtual void PreEarlyInitialization() OVERRIDE; | |
| 54 virtual void PreMainMessageLoopStart() OVERRIDE; | |
| 55 virtual void PostMainMessageLoopStart() OVERRIDE; | |
| 56 virtual int PreCreateThreads() OVERRIDE; | |
| 57 virtual void PreMainMessageLoopRun() OVERRIDE; | |
| 58 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; | |
| 59 virtual void PostMainMessageLoopRun() OVERRIDE; | |
| 60 | |
| 61 private: | |
| 62 scoped_ptr<AppShellBrowserContext> browser_context_; | |
| 63 scoped_ptr<AppShellExtensionsBrowserClient> extensions_browser_client_; | |
| 64 | |
| 65 // Enable a minimal set of views::corewm to be initialized. | |
| 66 scoped_ptr<wm::WMTestHelper> wm_test_helper_; | |
| 67 | |
| 68 DISALLOW_COPY_AND_ASSIGN(AppShellBrowserMainParts); | |
| 69 }; | |
| 70 | |
| 71 } // namespace apps | |
| 72 | |
| 73 #endif // APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_ | |
| OLD | NEW |