| 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 #include "apps/shell/app_shell_browser_main_parts.h" | 5 #include "apps/shell/app_shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "apps/shell/web_view_window.h" | 7 #include "apps/shell/web_view_window.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/public/common/result_codes.h" | 9 #include "content/public/common/result_codes.h" |
| 10 #include "content/shell/browser/shell_browser_context.h" | 10 #include "content/shell/browser/shell_browser_context.h" |
| 11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 12 #include "ui/aura/root_window.h" | 12 #include "ui/aura/root_window.h" |
| 13 #include "ui/aura/test/test_screen.h" | 13 #include "ui/aura/test/test_screen.h" |
| 14 #include "ui/shell/minimal_shell.h" | 14 #include "ui/wm/test/minimal_shell.h" |
| 15 | 15 |
| 16 namespace apps { | 16 namespace apps { |
| 17 | 17 |
| 18 AppShellBrowserMainParts::AppShellBrowserMainParts( | 18 AppShellBrowserMainParts::AppShellBrowserMainParts( |
| 19 const content::MainFunctionParams& parameters) { | 19 const content::MainFunctionParams& parameters) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 AppShellBrowserMainParts::~AppShellBrowserMainParts() { | 22 AppShellBrowserMainParts::~AppShellBrowserMainParts() { |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 35 void AppShellBrowserMainParts::PreMainMessageLoopRun() { | 35 void AppShellBrowserMainParts::PreMainMessageLoopRun() { |
| 36 // TODO(jamescook): Could initialize NetLog here to get logs from the | 36 // TODO(jamescook): Could initialize NetLog here to get logs from the |
| 37 // networking stack. | 37 // networking stack. |
| 38 // TODO(jamescook): Should this be an off-the-record context? | 38 // TODO(jamescook): Should this be an off-the-record context? |
| 39 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); | 39 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); |
| 40 | 40 |
| 41 // TODO(jamescook): Replace this with a real Screen implementation. | 41 // TODO(jamescook): Replace this with a real Screen implementation. |
| 42 gfx::Screen::SetScreenInstance( | 42 gfx::Screen::SetScreenInstance( |
| 43 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); | 43 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); |
| 44 // Set up basic pieces of views::corewm. | 44 // Set up basic pieces of views::corewm. |
| 45 minimal_shell_.reset(new shell::MinimalShell(gfx::Size(800, 600))); | 45 minimal_shell_.reset(new wm::MinimalShell(gfx::Size(800, 600))); |
| 46 // Ensure the X window gets mapped. | 46 // Ensure the X window gets mapped. |
| 47 minimal_shell_->root_window()->host()->Show(); | 47 minimal_shell_->root_window()->host()->Show(); |
| 48 | 48 |
| 49 // TODO(jamescook): Create an apps::ShellWindow here. For now, create a | 49 // TODO(jamescook): Create an apps::ShellWindow here. For now, create a |
| 50 // window with a WebView just to ensure that the content module is properly | 50 // window with a WebView just to ensure that the content module is properly |
| 51 // initialized. | 51 // initialized. |
| 52 ShowWebViewWindow(browser_context_.get(), | 52 ShowWebViewWindow(browser_context_.get(), |
| 53 minimal_shell_->root_window()->window()); | 53 minimal_shell_->root_window()->window()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool AppShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 56 bool AppShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 57 base::RunLoop run_loop; | 57 base::RunLoop run_loop; |
| 58 run_loop.Run(); | 58 run_loop.Run(); |
| 59 *result_code = content::RESULT_CODE_NORMAL_EXIT; | 59 *result_code = content::RESULT_CODE_NORMAL_EXIT; |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void AppShellBrowserMainParts::PostMainMessageLoopRun() { | 63 void AppShellBrowserMainParts::PostMainMessageLoopRun() { |
| 64 browser_context_.reset(); | 64 browser_context_.reset(); |
| 65 minimal_shell_.reset(); | 65 minimal_shell_.reset(); |
| 66 aura::Env::DeleteInstance(); | 66 aura::Env::DeleteInstance(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace apps | 69 } // namespace apps |
| OLD | NEW |