| 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/aura/wm_shell_aura.h" | 8 #include "ash/aura/wm_shell_aura.h" |
| 9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 ash::Shell* shell = ash::Shell::GetInstance(); | 107 ash::Shell* shell = ash::Shell::GetInstance(); |
| 108 | 108 |
| 109 ash::AcceleratorControllerDelegateAura* accelerator_controller_delegate = | 109 ash::AcceleratorControllerDelegateAura* accelerator_controller_delegate = |
| 110 nullptr; | 110 nullptr; |
| 111 if (chromeos::GetConfig() == ash::Config::CLASSIC) { | 111 if (chromeos::GetConfig() == ash::Config::CLASSIC) { |
| 112 accelerator_controller_delegate = | 112 accelerator_controller_delegate = |
| 113 ash::WmShellAura::Get()->accelerator_controller_delegate(); | 113 ash::WmShellAura::Get()->accelerator_controller_delegate(); |
| 114 } else if (chromeos::GetConfig() == ash::Config::MUS) { | 114 } else if (chromeos::GetConfig() == ash::Config::MUS) { |
| 115 accelerator_controller_delegate = | 115 accelerator_controller_delegate = |
| 116 ash::mus::WmShellMus::Get()->accelerator_controller_delegate_classic(); | 116 ash::mus::WmShellMus::Get()->accelerator_controller_delegate_mus(); |
| 117 } | 117 } |
| 118 if (accelerator_controller_delegate) { | 118 if (accelerator_controller_delegate) { |
| 119 std::unique_ptr<ChromeScreenshotGrabber> screenshot_delegate = | 119 std::unique_ptr<ChromeScreenshotGrabber> screenshot_delegate = |
| 120 base::MakeUnique<ChromeScreenshotGrabber>(); | 120 base::MakeUnique<ChromeScreenshotGrabber>(); |
| 121 accelerator_controller_delegate->SetScreenshotDelegate( | 121 accelerator_controller_delegate->SetScreenshotDelegate( |
| 122 std::move(screenshot_delegate)); | 122 std::move(screenshot_delegate)); |
| 123 } | 123 } |
| 124 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. | 124 // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. |
| 125 chromeos::AccelerometerReader::GetInstance()->Initialize( | 125 chromeos::AccelerometerReader::GetInstance()->Initialize( |
| 126 content::BrowserThread::GetBlockingPool() | 126 content::BrowserThread::GetBlockingPool() |
| (...skipping 22 matching lines...) Expand all Loading... |
| 149 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 149 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 AshInit::~AshInit() { | 152 AshInit::~AshInit() { |
| 153 // |window_manager_| deletes the Shell. | 153 // |window_manager_| deletes the Shell. |
| 154 if (!window_manager_ && ash::Shell::HasInstance()) { | 154 if (!window_manager_ && ash::Shell::HasInstance()) { |
| 155 ash::Shell::DeleteInstance(); | 155 ash::Shell::DeleteInstance(); |
| 156 ash::ShellContentState::DestroyInstance(); | 156 ash::ShellContentState::DestroyInstance(); |
| 157 } | 157 } |
| 158 } | 158 } |
| OLD | NEW |