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

Unified Diff: chrome/browser/extensions/global_shortcut_listener_win.h

Issue 1092183005: Fix Up SingletonHwnd Observer Lifetime Issues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow null SingletonHwnd Hwnd Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/global_shortcut_listener_win.h
diff --git a/chrome/browser/extensions/global_shortcut_listener_win.h b/chrome/browser/extensions/global_shortcut_listener_win.h
index 9bca78c580f706f82d7704e618cda1117302e805..cf6430fb05a56a4e0c308769672300faa4788f03 100644
--- a/chrome/browser/extensions/global_shortcut_listener_win.h
+++ b/chrome/browser/extensions/global_shortcut_listener_win.h
@@ -7,26 +7,23 @@
#include <windows.h>
+#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/global_shortcut_listener.h"
-#include "ui/gfx/win/singleton_hwnd.h"
+#include "ui/gfx/win/singleton_hwnd_observer.h"
namespace extensions {
// Windows-specific implementation of the GlobalShortcutListener class that
// listens for global shortcuts. Handles setting up a keyboard hook and
// forwarding its output to the base class for processing.
-class GlobalShortcutListenerWin : public GlobalShortcutListener,
- public gfx::SingletonHwnd::Observer {
+class GlobalShortcutListenerWin : public GlobalShortcutListener {
public:
GlobalShortcutListenerWin();
~GlobalShortcutListenerWin() override;
private:
- // The implementation of our Window Proc, called by SingletonHwnd.
- void OnWndProc(HWND hwnd,
- UINT message,
- WPARAM wparam,
- LPARAM lparam) override;
+ // The implementation of our Window Proc, called by SingletonHwndObserver.
+ void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
// GlobalShortcutListener implementation.
void StartListening() override;
@@ -41,6 +38,8 @@ class GlobalShortcutListenerWin : public GlobalShortcutListener,
typedef std::map<ui::Accelerator, int> HotkeyIdMap;
HotkeyIdMap hotkey_ids_;
+ scoped_ptr<gfx::SingletonHwndObserver> singleton_hwnd_observer_;
+
DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerWin);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/global_shortcut_listener_win.cc » ('j') | ui/gfx/sys_color_change_listener.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698