Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/extensions/global_shortcut_listener_mac.cc

Issue 60353008: Mac global keybindings (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 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_mac.h"
6
7 #include "content/public/browser/browser_thread.h"
8
9 using content::BrowserThread;
10
11 namespace {
12
13 static base::LazyInstance<extensions::GlobalShortcutListenerMac> instance =
14 LAZY_INSTANCE_INITIALIZER;
15
16 } // namespace
17
18 namespace extensions {
19
20 // static
21 GlobalShortcutListener* GlobalShortcutListener::GetInstance() {
22 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
23 return instance.Pointer();
24 }
25
26 GlobalShortcutListenerMac::GlobalShortcutListenerMac()
27 : is_listening_(false) {
28 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
29
30 // TODO(implementor): Remove this.
31 LOG(ERROR) << "GlobalShortcutListenerMac object created";
32 }
33
34 GlobalShortcutListenerMac::~GlobalShortcutListenerMac() {
35 if (is_listening_)
36 StopListening();
37 }
38
39 void GlobalShortcutListenerMac::StartListening() {
40 DCHECK(!is_listening_); // Don't start twice.
41 NOTIMPLEMENTED();
42 is_listening_ = true;
43 }
44
45 void GlobalShortcutListenerMac::StopListening() {
46 DCHECK(is_listening_); // No point if we are not already listening.
47 NOTIMPLEMENTED();
48 is_listening_ = false;
49 }
50
51 void GlobalShortcutListenerMac::RegisterAccelerator(
52 const ui::Accelerator& accelerator,
53 GlobalShortcutListener::Observer* observer) {
54 NOTIMPLEMENTED();
55 // To implement:
56 // 1) Convert modifiers to platform specific modifiers.
57 // 2) Register for the hotkey.
58 // 3) If not successful, log why.
59 // 4) Else, call base class RegisterAccelerator.
60
61 GlobalShortcutListener::RegisterAccelerator(accelerator, observer);
62 }
63
64 void GlobalShortcutListenerMac::UnregisterAccelerator(
65 const ui::Accelerator& accelerator,
66 GlobalShortcutListener::Observer* observer) {
67 NOTIMPLEMENTED();
68 // To implement:
69 // 1) Unregister for the hotkey.
70 // 2) Call base class UnregisterAccelerator.
71
72 GlobalShortcutListener::UnregisterAccelerator(accelerator, observer);
73 }
74
75 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698