blob: 287092529cbd228c1d93d8888f2e02f0a42eaf69 [file] [log] [blame]
// Copyright 2021 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 "chrome/browser/extensions/global_shortcut_listener.h"
#include "content/public/browser/browser_thread.h"
#if defined(USE_OZONE)
#include "chrome/browser/extensions/global_shortcut_listener_ozone.h"
#include "ui/base/ui_base_features.h"
#endif
#if defined(USE_X11)
#include "chrome/browser/extensions/global_shortcut_listener_x11.h"
#endif
using content::BrowserThread;
namespace extensions {
// static
GlobalShortcutListener* GlobalShortcutListener::GetInstance() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
#if defined(USE_OZONE)
if (features::IsUsingOzonePlatform()) {
static GlobalShortcutListenerOzone* instance =
new GlobalShortcutListenerOzone();
return instance;
}
#endif
#if defined(USE_X11)
static GlobalShortcutListenerX11* instance = new GlobalShortcutListenerX11();
return instance;
#else
NOTREACHED();
return nullptr;
#endif
}
} // namespace extensions