summaryrefslogtreecommitdiffstats
path: root/ash/content/shell_content_state.cc
blob: 990c27c0d524e3617f3a4a87ac2e9d1bfb2aadc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/content/shell_content_state.h"

#include "base/logging.h"
#include "ui/keyboard/content/keyboard.h"

namespace ash {

// static
ShellContentState* ShellContentState::instance_ = nullptr;

// static
void ShellContentState::SetInstance(ShellContentState* instance) {
  DCHECK(!instance_);
  instance_ = instance;
}

// static
ShellContentState* ShellContentState::GetInstance() {
  DCHECK(instance_);
  return instance_;
}

// static
void ShellContentState::DestroyInstance() {
  DCHECK(instance_);
  delete instance_;
  instance_ = nullptr;
}

ShellContentState::ShellContentState() {
// The keyboard system must be initialized before the RootWindowController is
// created.
#if defined(OS_CHROMEOS)
  keyboard::InitializeKeyboard();
#endif
}
ShellContentState::~ShellContentState() {}

}  // namespace ash