| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/ui/ash/ash_init.h" | 5 #include "chrome/browser/ui/ash/ash_init.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerometer/accelerometer_controller.h" | 8 #include "ash/accelerometer/accelerometer_controller.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/high_contrast/high_contrast_controller.h" | 10 #include "ash/high_contrast/high_contrast_controller.h" |
| 11 #include "ash/magnifier/magnification_controller.h" | 11 #include "ash/magnifier/magnification_controller.h" |
| 12 #include "ash/magnifier/partial_magnification_controller.h" | 12 #include "ash/magnifier/partial_magnification_controller.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "ash/shell_init_params.h" | 14 #include "ash/shell_init_params.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "chrome/browser/browser_shutdown.h" | 16 #include "chrome/browser/browser_shutdown.h" |
| 17 #include "chrome/browser/lifetime/application_lifetime.h" | 17 #include "chrome/browser/lifetime/application_lifetime.h" |
| 18 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 18 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 19 #include "chrome/browser/ui/ash/screenshot_taker.h" | 19 #include "chrome/browser/ui/ash/screenshot_taker.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/browser/context_factory.h" |
| 22 #include "ui/aura/env.h" | 23 #include "ui/aura/env.h" |
| 23 #include "ui/aura/window_tree_host.h" | 24 #include "ui/aura/window_tree_host.h" |
| 24 | 25 |
| 25 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 26 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
| 27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 28 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 29 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 30 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
| 30 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 31 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
| 31 #include "chromeos/chromeos_switches.h" | 32 #include "chromeos/chromeos_switches.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 55 #endif | 56 #endif |
| 56 | 57 |
| 57 // Hide the mouse cursor completely at boot. | 58 // Hide the mouse cursor completely at boot. |
| 58 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) | 59 if (!chromeos::LoginState::Get()->IsUserLoggedIn()) |
| 59 ash::Shell::set_initially_hide_cursor(true); | 60 ash::Shell::set_initially_hide_cursor(true); |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 ash::ShellInitParams shell_init_params; | 63 ash::ShellInitParams shell_init_params; |
| 63 // Shell takes ownership of ChromeShellDelegate. | 64 // Shell takes ownership of ChromeShellDelegate. |
| 64 shell_init_params.delegate = new ChromeShellDelegate; | 65 shell_init_params.delegate = new ChromeShellDelegate; |
| 66 shell_init_params.context_factory = content::GetContextFactory(); |
| 65 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 66 shell_init_params.remote_hwnd = remote_window; | 68 shell_init_params.remote_hwnd = remote_window; |
| 67 #endif | 69 #endif |
| 68 | 70 |
| 69 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); | 71 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); |
| 70 shell->accelerator_controller()->SetScreenshotDelegate( | 72 shell->accelerator_controller()->SetScreenshotDelegate( |
| 71 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); | 73 scoped_ptr<ash::ScreenshotDelegate>(new ScreenshotTaker).Pass()); |
| 72 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 74 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
| 73 shell->accelerometer_controller()->Initialize( | 75 shell->accelerometer_controller()->Initialize( |
| 74 content::BrowserThread::GetBlockingPool()-> | 76 content::BrowserThread::GetBlockingPool()-> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 97 #endif | 99 #endif |
| 98 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 100 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
| 99 } | 101 } |
| 100 | 102 |
| 101 void CloseAsh() { | 103 void CloseAsh() { |
| 102 if (ash::Shell::HasInstance()) | 104 if (ash::Shell::HasInstance()) |
| 103 ash::Shell::DeleteInstance(); | 105 ash::Shell::DeleteInstance(); |
| 104 } | 106 } |
| 105 | 107 |
| 106 } // namespace chrome | 108 } // namespace chrome |
| OLD | NEW |