| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/content/shell_content_state.h" | 5 #include "ash/content/shell_content_state.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/keyboard/content/keyboard.h" |
| 8 | 9 |
| 9 namespace ash { | 10 namespace ash { |
| 10 | 11 |
| 11 // static | 12 // static |
| 12 ShellContentState* ShellContentState::instance_ = nullptr; | 13 ShellContentState* ShellContentState::instance_ = nullptr; |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 void ShellContentState::SetInstance(ShellContentState* instance) { | 16 void ShellContentState::SetInstance(ShellContentState* instance) { |
| 16 DCHECK(!instance_); | 17 DCHECK(!instance_); |
| 17 instance_ = instance; | 18 instance_ = instance; |
| 18 } | 19 } |
| 19 | 20 |
| 20 // static | 21 // static |
| 21 ShellContentState* ShellContentState::GetInstance() { | 22 ShellContentState* ShellContentState::GetInstance() { |
| 22 DCHECK(instance_); | 23 DCHECK(instance_); |
| 23 return instance_; | 24 return instance_; |
| 24 } | 25 } |
| 25 | 26 |
| 26 // static | 27 // static |
| 27 void ShellContentState::DestroyInstance() { | 28 void ShellContentState::DestroyInstance() { |
| 28 DCHECK(instance_); | 29 DCHECK(instance_); |
| 29 delete instance_; | 30 delete instance_; |
| 30 instance_ = nullptr; | 31 instance_ = nullptr; |
| 31 } | 32 } |
| 32 | 33 |
| 33 ShellContentState::ShellContentState() {} | 34 ShellContentState::ShellContentState() { |
| 35 // The keyboard system must be initialized before the RootWindowController is |
| 36 // created. |
| 37 #if defined(OS_CHROMEOS) |
| 38 keyboard::InitializeKeyboard(); |
| 39 #endif |
| 40 } |
| 34 ShellContentState::~ShellContentState() {} | 41 ShellContentState::~ShellContentState() {} |
| 35 | 42 |
| 36 } // namespace ash | 43 } // namespace ash |
| OLD | NEW |