1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/extensions/global_shortcut_listener_ozone.h" 6 7 #include "content/public/browser/browser_thread.h" 8 9 using content::BrowserThread; 10 11 namespace extensions { 12 13 // static 14 GlobalShortcutListener* GlobalShortcutListener::GetInstance() { 15 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 16 static GlobalShortcutListenerOzone* instance = 17 new GlobalShortcutListenerOzone(); 18 return instance; 19 } 20 21 GlobalShortcutListenerOzone::GlobalShortcutListenerOzone() 22 : is_listening_(false) { 23 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 24 25 // TODO(implementor): Remove this. 26 LOG(ERROR) << "GlobalShortcutListenerOzone object created"; 27 } 28 29 GlobalShortcutListenerOzone::~GlobalShortcutListenerOzone() { 30 if (is_listening_) 31 StopListening(); 32 } 33 34 void GlobalShortcutListenerOzone::StartListening() { 35 DCHECK(!is_listening_); // Don't start twice. 36 NOTIMPLEMENTED(); 37 is_listening_ = true; 38 } 39 40 void GlobalShortcutListenerOzone::StopListening() { 41 DCHECK(is_listening_); // No point if we are not already listening. 42 NOTIMPLEMENTED(); 43 is_listening_ = false; 44 } 45 46 bool GlobalShortcutListenerOzone::RegisterAcceleratorImpl( 47 const ui::Accelerator& accelerator) { 48 NOTIMPLEMENTED(); 49 // To implement: 50 // 1) Convert modifiers to platform specific modifiers. 51 // 2) Register for the hotkey. 52 // 3) If not successful, return false. 53 // 4) Else, return true. 54 55 return false; 56 } 57 58 void GlobalShortcutListenerOzone::UnregisterAcceleratorImpl( 59 const ui::Accelerator& accelerator) { 60 NOTIMPLEMENTED(); 61 // To implement: Unregister for the hotkey. 62 } 63 64 } // namespace extensions 65