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_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
8 #include "ash/common/accelerators/accelerator_controller.h" | 8 #include "ash/common/accelerators/accelerator_controller.h" |
9 #include "ash/common/accessibility_types.h" | 9 #include "ash/common/accessibility_types.h" |
10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 27 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
28 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" | 28 #include "chrome/browser/ui/ash/ime_controller_chromeos.h" |
29 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h" | 29 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h" |
30 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" | 30 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" |
31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
32 #include "chromeos/accelerometer/accelerometer_reader.h" | 32 #include "chromeos/accelerometer/accelerometer_reader.h" |
33 #include "chromeos/chromeos_switches.h" | 33 #include "chromeos/chromeos_switches.h" |
34 #include "chromeos/login/login_state.h" | 34 #include "chromeos/login/login_state.h" |
35 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
36 #include "content/public/browser/context_factory.h" | 36 #include "content/public/browser/context_factory.h" |
| 37 #include "content/public/common/mojo_shell_connection.h" |
37 #include "ui/aura/env.h" | 38 #include "ui/aura/env.h" |
38 #include "ui/aura/window_tree_host.h" | 39 #include "ui/aura/window_tree_host.h" |
39 | 40 |
40 #if defined(USE_X11) | 41 #if defined(USE_X11) |
41 #include "ui/base/x/x11_util.h" // nogncheck | 42 #include "ui/base/x/x11_util.h" // nogncheck |
42 #endif | 43 #endif |
43 | 44 |
44 namespace chrome { | 45 namespace chrome { |
45 | 46 |
46 void OpenAsh(gfx::AcceleratedWidget remote_window) { | 47 void OpenAsh(gfx::AcceleratedWidget remote_window) { |
(...skipping 11 matching lines...) Expand all Loading... |
58 ash::Shell::set_initially_hide_cursor(true); | 59 ash::Shell::set_initially_hide_cursor(true); |
59 | 60 |
60 // Balanced by a call to DestroyInstance() in CloseAsh() below. | 61 // Balanced by a call to DestroyInstance() in CloseAsh() below. |
61 ash::ShellContentState::SetInstance(new ChromeShellContentState); | 62 ash::ShellContentState::SetInstance(new ChromeShellContentState); |
62 | 63 |
63 ash::ShellInitParams shell_init_params; | 64 ash::ShellInitParams shell_init_params; |
64 // Shell takes ownership of ChromeShellDelegate. | 65 // Shell takes ownership of ChromeShellDelegate. |
65 shell_init_params.delegate = new ChromeShellDelegate; | 66 shell_init_params.delegate = new ChromeShellDelegate; |
66 shell_init_params.context_factory = content::GetContextFactory(); | 67 shell_init_params.context_factory = content::GetContextFactory(); |
67 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 68 shell_init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
| 69 shell_init_params.connector = |
| 70 content::MojoShellConnection::GetForProcess()->GetConnector(); |
| 71 DCHECK(shell_init_params.connector); |
68 | 72 |
69 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); | 73 ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); |
70 shell->accelerator_controller_delegate()->SetScreenshotDelegate( | 74 shell->accelerator_controller_delegate()->SetScreenshotDelegate( |
71 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); | 75 std::unique_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); |
72 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 76 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
73 chromeos::AccelerometerReader::GetInstance()->Initialize( | 77 chromeos::AccelerometerReader::GetInstance()->Initialize( |
74 content::BrowserThread::GetBlockingPool() | 78 content::BrowserThread::GetBlockingPool() |
75 ->GetSequencedTaskRunnerWithShutdownBehavior( | 79 ->GetSequencedTaskRunnerWithShutdownBehavior( |
76 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), | 80 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
77 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 81 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
(...skipping 25 matching lines...) Expand all Loading... |
103 } | 107 } |
104 | 108 |
105 void CloseAsh() { | 109 void CloseAsh() { |
106 if (ash::Shell::HasInstance()) { | 110 if (ash::Shell::HasInstance()) { |
107 ash::Shell::DeleteInstance(); | 111 ash::Shell::DeleteInstance(); |
108 ash::ShellContentState::DestroyInstance(); | 112 ash::ShellContentState::DestroyInstance(); |
109 } | 113 } |
110 } | 114 } |
111 | 115 |
112 } // namespace chrome | 116 } // namespace chrome |
OLD | NEW |