blob: e0b219e9e22ecca566de92f6dc0fca61ffdba278 [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2021 The Chromium Authors
Jimmy Gong64d2c632021-11-03 10:41:442// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/base/shortcut_mapping_pref_delegate.h"
6
7#include "base/check.h"
8#include "base/check_op.h"
9
10namespace ui {
11
12// static
13ShortcutMappingPrefDelegate* ShortcutMappingPrefDelegate::instance_ = nullptr;
14
15// static
16ShortcutMappingPrefDelegate* ShortcutMappingPrefDelegate::GetInstance() {
17 return instance_;
18}
19
20// static
21bool ShortcutMappingPrefDelegate::IsInitialized() {
22 return instance_ != nullptr;
23}
24
25ShortcutMappingPrefDelegate::ShortcutMappingPrefDelegate() {
26 DCHECK(!instance_);
27 instance_ = this;
28}
29
30ShortcutMappingPrefDelegate::~ShortcutMappingPrefDelegate() {
31 DCHECK_EQ(instance_, this);
32 instance_ = nullptr;
33}
34
35} // namespace ui