OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_WM_IPC_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_WM_IPC_H_ |
6 #define CHROME_BROWSER_CHROMEOS_WM_IPC_H_ | 6 #define CHROME_BROWSER_CHROMEOS_WM_IPC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <map> | 10 #include <map> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Handles ClientMessage events that weren't decodable using DecodeMessage(). | 108 // Handles ClientMessage events that weren't decodable using DecodeMessage(). |
109 // Specifically, this catches messages about the WM_S0 selection that get sent | 109 // Specifically, this catches messages about the WM_S0 selection that get sent |
110 // when a window manager process starts (so that we can re-run InitWmInfo()). | 110 // when a window manager process starts (so that we can re-run InitWmInfo()). |
111 // See ICCCM 2.8 for more info about MANAGER selections. | 111 // See ICCCM 2.8 for more info about MANAGER selections. |
112 void HandleNonChromeClientMessageEvent(const GdkEventClient& event); | 112 void HandleNonChromeClientMessageEvent(const GdkEventClient& event); |
113 | 113 |
114 // Sets a _CHROME_LOGGED_IN property on the root window describing whether | 114 // Sets a _CHROME_LOGGED_IN property on the root window describing whether |
115 // the user is currently logged in or not. | 115 // the user is currently logged in or not. |
116 void SetLoggedInProperty(bool logged_in); | 116 void SetLoggedInProperty(bool logged_in); |
117 | 117 |
| 118 // Sends a message to the window manager notifying it that we're signing out. |
| 119 void NotifyAboutSignout(); |
| 120 |
118 private: | 121 private: |
119 friend struct base::DefaultLazyInstanceTraits<WmIpc>; | 122 friend struct base::DefaultLazyInstanceTraits<WmIpc>; |
120 | 123 |
121 WmIpc(); | 124 WmIpc(); |
122 | 125 |
123 // Initialize 'wm_' and send the window manager a message telling it the | 126 // Initialize 'wm_' and send the window manager a message telling it the |
124 // version of the IPC protocol that we support. This is called in our | 127 // version of the IPC protocol that we support. This is called in our |
125 // constructor, but needs to be re-run if the window manager gets restarted. | 128 // constructor, but needs to be re-run if the window manager gets restarted. |
126 void InitWmInfo(); | 129 void InitWmInfo(); |
127 | 130 |
128 // Maps from our Atom enum to the X server's atom IDs and from the | 131 // Maps from our Atom enum to the X server's atom IDs and from the |
129 // server's IDs to atoms' string names. These maps aren't necessarily in | 132 // server's IDs to atoms' string names. These maps aren't necessarily in |
130 // sync; 'atom_to_xatom_' is constant after the constructor finishes but | 133 // sync; 'atom_to_xatom_' is constant after the constructor finishes but |
131 // GetName() caches additional string mappings in 'xatom_to_string_'. | 134 // GetName() caches additional string mappings in 'xatom_to_string_'. |
132 std::map<AtomType, Atom> type_to_atom_; | 135 std::map<AtomType, Atom> type_to_atom_; |
133 std::map<Atom, std::string> atom_to_string_; | 136 std::map<Atom, std::string> atom_to_string_; |
134 | 137 |
135 // Cached value of type_to_atom_[ATOM_CHROME_WM_MESSAGE]. | 138 // Cached value of type_to_atom_[ATOM_CHROME_WM_MESSAGE]. |
136 Atom wm_message_atom_; | 139 Atom wm_message_atom_; |
137 | 140 |
138 // Handle to the wm. Used for sending messages. | 141 // Handle to the wm. Used for sending messages. |
139 XID wm_; | 142 XID wm_; |
140 | 143 |
141 DISALLOW_COPY_AND_ASSIGN(WmIpc); | 144 DISALLOW_COPY_AND_ASSIGN(WmIpc); |
142 }; | 145 }; |
143 | 146 |
144 } // namespace chromeos | 147 } // namespace chromeos |
145 | 148 |
146 #endif // CHROME_BROWSER_CHROMEOS_WM_IPC_H_ | 149 #endif // CHROME_BROWSER_CHROMEOS_WM_IPC_H_ |
OLD | NEW |