| Index: chrome/browser/extensions/global_shortcut_listener_win.cc
|
| diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
|
| index 8f6f1912e36fc0b7a63893473c190c32798d1b9c..5d25c7ca0bad7b35aa681d9d597532cf65c5c097 100644
|
| --- a/chrome/browser/extensions/global_shortcut_listener_win.cc
|
| +++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "chrome/browser/extensions/global_shortcut_listener_win.h"
|
|
|
| +#include "base/bind.h"
|
| +#include "base/bind_helpers.h"
|
| #include "base/win/win_util.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "ui/base/accelerators/accelerator.h"
|
| @@ -35,21 +37,22 @@ GlobalShortcutListenerWin::~GlobalShortcutListenerWin() {
|
| void GlobalShortcutListenerWin::StartListening() {
|
| DCHECK(!is_listening_); // Don't start twice.
|
| DCHECK(!hotkey_ids_.empty()); // Also don't start if no hotkey is registered.
|
| - gfx::SingletonHwnd::GetInstance()->AddObserver(this);
|
| + singletonHwndObserver_.SetWndProc(
|
| + base::Bind(&GlobalShortcutListenerWin::OnHotkey, base::Unretained(this)));
|
| is_listening_ = true;
|
| }
|
|
|
| void GlobalShortcutListenerWin::StopListening() {
|
| DCHECK(is_listening_); // No point if we are not already listening.
|
| DCHECK(hotkey_ids_.empty()); // Make sure the map is clean before ending.
|
| - gfx::SingletonHwnd::GetInstance()->RemoveObserver(this);
|
| + singletonHwndObserver_.ClearWndProc();
|
| is_listening_ = false;
|
| }
|
|
|
| -void GlobalShortcutListenerWin::OnWndProc(HWND hwnd,
|
| - UINT message,
|
| - WPARAM wparam,
|
| - LPARAM lparam) {
|
| +void GlobalShortcutListenerWin::OnHotkey(HWND hwnd,
|
| + UINT message,
|
| + WPARAM wparam,
|
| + LPARAM lparam) {
|
| if (message != WM_HOTKEY)
|
| return;
|
|
|
|
|