| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_ | 5 #ifndef APPS_SHELL_SHELL_BROWSER_MAIN_PARTS_H_ |
| 6 #define APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_ | 6 #define APPS_SHELL_SHELL_BROWSER_MAIN_PARTS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/browser/browser_main_parts.h" | 11 #include "content/public/browser/browser_main_parts.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class ShellBrowserContext; | 18 class ShellBrowserContext; |
| 19 struct MainFunctionParams; | 19 struct MainFunctionParams; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace views { | 22 namespace views { |
| 23 class ViewsDelegate; | 23 class ViewsDelegate; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace wm { | 26 namespace wm { |
| 27 class WMTestHelper; | 27 class WMTestHelper; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace apps { | 30 namespace apps { |
| 31 | 31 |
| 32 class AppShellBrowserContext; | 32 class ShellBrowserContext; |
| 33 class AppShellExtensionsBrowserClient; | 33 class ShellExtensionsBrowserClient; |
| 34 | 34 |
| 35 // Handles initialization of AppShell. | 35 // Handles initialization of AppShell. |
| 36 class AppShellBrowserMainParts : public content::BrowserMainParts { | 36 class ShellBrowserMainParts : public content::BrowserMainParts { |
| 37 public: | 37 public: |
| 38 explicit AppShellBrowserMainParts( | 38 explicit ShellBrowserMainParts( |
| 39 const content::MainFunctionParams& parameters); | 39 const content::MainFunctionParams& parameters); |
| 40 virtual ~AppShellBrowserMainParts(); | 40 virtual ~ShellBrowserMainParts(); |
| 41 | 41 |
| 42 AppShellBrowserContext* browser_context() { | 42 ShellBrowserContext* browser_context() { |
| 43 return browser_context_.get(); | 43 return browser_context_.get(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // Creates the window that hosts the apps. | 46 // Creates the window that hosts the apps. |
| 47 void CreateRootWindow(); | 47 void CreateRootWindow(); |
| 48 | 48 |
| 49 // Launches an application from a directory. | 49 // Launches an application from a directory. |
| 50 void LoadAndLaunchApp(const base::FilePath& app_dir); | 50 void LoadAndLaunchApp(const base::FilePath& app_dir); |
| 51 | 51 |
| 52 // BrowserMainParts overrides. | 52 // BrowserMainParts overrides. |
| 53 virtual void PreEarlyInitialization() OVERRIDE; | 53 virtual void PreEarlyInitialization() OVERRIDE; |
| 54 virtual void PreMainMessageLoopStart() OVERRIDE; | 54 virtual void PreMainMessageLoopStart() OVERRIDE; |
| 55 virtual void PostMainMessageLoopStart() OVERRIDE; | 55 virtual void PostMainMessageLoopStart() OVERRIDE; |
| 56 virtual int PreCreateThreads() OVERRIDE; | 56 virtual int PreCreateThreads() OVERRIDE; |
| 57 virtual void PreMainMessageLoopRun() OVERRIDE; | 57 virtual void PreMainMessageLoopRun() OVERRIDE; |
| 58 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; | 58 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; |
| 59 virtual void PostMainMessageLoopRun() OVERRIDE; | 59 virtual void PostMainMessageLoopRun() OVERRIDE; |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 scoped_ptr<AppShellBrowserContext> browser_context_; | 62 scoped_ptr<ShellBrowserContext> browser_context_; |
| 63 scoped_ptr<AppShellExtensionsBrowserClient> extensions_browser_client_; | 63 scoped_ptr<ShellExtensionsBrowserClient> extensions_browser_client_; |
| 64 | 64 |
| 65 // Enable a minimal set of views::corewm to be initialized. | 65 // Enable a minimal set of views::corewm to be initialized. |
| 66 scoped_ptr<wm::WMTestHelper> wm_test_helper_; | 66 scoped_ptr<wm::WMTestHelper> wm_test_helper_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(AppShellBrowserMainParts); | 68 DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace apps | 71 } // namespace apps |
| 72 | 72 |
| 73 #endif // APPS_SHELL_APP_SHELL_BROWSER_MAIN_PARTS_H_ | 73 #endif // APPS_SHELL_SHELL_BROWSER_MAIN_PARTS_H_ |
| OLD | NEW |