Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / views / win / windows_session_change_observer.h
blob38a3e084c7bbdb1d0585c5f6035d5795ff50d663
1 // Copyright 2015 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.
5 #ifndef UI_VIEWS_WIN_WINDOWS_SESSION_CHANGE_OBSERVER_H_
6 #define UI_VIEWS_WIN_WINDOWS_SESSION_CHANGE_OBSERVER_H_
8 #include <windows.h>
10 #include "base/callback.h"
11 #include "base/macros.h"
13 namespace views {
15 // Calls the provided callback on WM_WTSSESSION_CHANGE messages along with
16 // managing the tricky business of observing a singleton object.
17 class WindowsSessionChangeObserver {
18 public:
19 typedef base::Callback<void(WPARAM)> WtsCallback;
20 explicit WindowsSessionChangeObserver(const WtsCallback& callback);
21 ~WindowsSessionChangeObserver();
23 private:
24 class WtsRegistrationNotificationManager;
26 void OnSessionChange(WPARAM wparam);
27 void ClearCallback();
29 WtsCallback callback_;
31 DISALLOW_COPY_AND_ASSIGN(WindowsSessionChangeObserver);
34 } // namespace views
36 #endif // UI_VIEWS_WIN_WINDOWS_SESSION_CHANGE_OBSERVER_H_