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/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
10 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 shell_init_params.context_factory = content::GetContextFactory(); | 58 shell_init_params.context_factory = content::GetContextFactory(); |
59 #if defined(OS_WIN) | 59 #if defined(OS_WIN) |
60 shell_init_params.remote_hwnd = remote_window; | 60 shell_init_params.remote_hwnd = remote_window; |
61 #endif | 61 #endif |
62 | 62 |
63 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); | 63 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); |
64 shell->accelerator_controller()->SetScreenshotDelegate( | 64 shell->accelerator_controller()->SetScreenshotDelegate( |
65 scoped_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber).Pass()); | 65 scoped_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber).Pass()); |
66 #if defined(OS_CHROMEOS) | 66 #if defined(OS_CHROMEOS) |
67 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 67 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
68 shell->accelerometer_reader()->Initialize( | 68 chromeos::AccelerometerReader::GetInstance()->Initialize( |
69 content::BrowserThread::GetBlockingPool() | 69 content::BrowserThread::GetBlockingPool() |
70 ->GetTaskRunnerWithShutdownBehavior( | 70 ->GetTaskRunnerWithShutdownBehavior( |
71 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 71 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
72 shell->accelerator_controller()->SetImeControlDelegate( | 72 shell->accelerator_controller()->SetImeControlDelegate( |
73 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); | 73 scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass()); |
74 shell->high_contrast_controller()->SetEnabled( | 74 shell->high_contrast_controller()->SetEnabled( |
75 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); | 75 chromeos::AccessibilityManager::Get()->IsHighContrastEnabled()); |
76 | 76 |
77 DCHECK(chromeos::MagnificationManager::Get()); | 77 DCHECK(chromeos::MagnificationManager::Get()); |
78 bool magnifier_enabled = | 78 bool magnifier_enabled = |
(...skipping 12 matching lines...) Expand all Loading... |
91 #endif | 91 #endif |
92 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 92 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
93 } | 93 } |
94 | 94 |
95 void CloseAsh() { | 95 void CloseAsh() { |
96 if (ash::Shell::HasInstance()) | 96 if (ash::Shell::HasInstance()) |
97 ash::Shell::DeleteInstance(); | 97 ash::Shell::DeleteInstance(); |
98 } | 98 } |
99 | 99 |
100 } // namespace chrome | 100 } // namespace chrome |
OLD | NEW |