Index: chrome/browser/chromeos/legacy_window_manager/wm_ipc.h |
diff --git a/chrome/browser/chromeos/legacy_window_manager/wm_ipc.h b/chrome/browser/chromeos/legacy_window_manager/wm_ipc.h |
index d4a48b4bfe3531ad4e86cf3827ea16c2c623ad4c..da200f768bfa58de4df6300e54a16ce81e6bf242 100644 |
--- a/chrome/browser/chromeos/legacy_window_manager/wm_ipc.h |
+++ b/chrome/browser/chromeos/legacy_window_manager/wm_ipc.h |
@@ -7,17 +7,14 @@ |
#pragma once |
#include <gtk/gtk.h> |
-#include <map> |
#include <set> |
#include <string> |
#include <vector> |
#include "base/logging.h" |
+#include "views/widget/wm_ipc.h" |
#include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
-typedef unsigned long Atom; |
-typedef unsigned long XID; |
- |
namespace base { |
template <typename T> struct DefaultLazyInstanceTraits; |
} |
@@ -29,67 +26,8 @@ namespace chromeos { |
class WmIpc { |
public: |
- enum AtomType { |
- ATOM_CHROME_LAYOUT_MODE = 0, |
- ATOM_CHROME_LOGGED_IN, |
- ATOM_CHROME_STATE, |
- ATOM_CHROME_STATE_COLLAPSED_PANEL, |
- ATOM_CHROME_STATE_STATUS_HIDDEN, |
- ATOM_CHROME_STATUS_BOUNDS, |
- ATOM_CHROME_WINDOW_TYPE, |
- ATOM_CHROME_WM_MESSAGE, |
- ATOM_MANAGER, |
- ATOM_STRING, |
- ATOM_UTF8_STRING, |
- ATOM_WM_S0, |
- kNumAtoms, |
- }; |
- |
- struct Message { |
- public: |
- Message() { |
- Init(WM_IPC_MESSAGE_UNKNOWN); |
- } |
- // WmIpcMessageType is defined in chromeos_wm_ipc_enums.h. |
- explicit Message(WmIpcMessageType type) { |
- Init(type); |
- } |
- |
- WmIpcMessageType type() const { return type_; } |
- void set_type(WmIpcMessageType type) { type_ = type; } |
- |
- inline int max_params() const { |
- return arraysize(params_); |
- } |
- long param(int index) const { |
- DCHECK_GE(index, 0); |
- DCHECK_LT(index, max_params()); |
- return params_[index]; |
- } |
- void set_param(int index, long value) { |
- DCHECK_GE(index, 0); |
- DCHECK_LT(index, max_params()); |
- params_[index] = value; |
- } |
- |
- private: |
- // Common initialization code shared between constructors. |
- void Init(WmIpcMessageType type) { |
- set_type(type); |
- for (int i = 0; i < max_params(); ++i) { |
- set_param(i, 0); |
- } |
- } |
- |
- // Type of message that was sent. |
- WmIpcMessageType type_; |
- |
- // Type-specific data. This is bounded by the number of 32-bit values |
- // that we can pack into a ClientMessageEvent -- it holds five, but we |
- // use the first one to store the message type. |
- long params_[4]; |
- }; |
- |
+ typedef views::chromeos::WmIpc::AtomType AtomType; |
+ typedef views::chromeos::WmIpc::Message Message; |
// Returns the single instance of WmIpc. |
static WmIpc* instance(); |
@@ -149,27 +87,10 @@ class WmIpc { |
WmIpc(); |
~WmIpc(); |
- // Initializes 'wm_' and sends the window manager a message telling it the |
- // version of the IPC protocol that we support. This is called in our |
- // constructor, but needs to be re-run if the window manager gets restarted. |
- void InitWmInfo(); |
- |
// Updates |layout_mode_| based on the current value of the root window's |
// _CHROME_LAYOUT_MODE property. |
void FetchLayoutModeProperty(); |
- // Maps between our Atom enum and the X server's atom IDs and from the |
- // server's IDs to atoms' string names. |
- std::map<AtomType, Atom> type_to_atom_; |
- std::map<Atom, AtomType> atom_to_type_; |
- std::map<Atom, std::string> atom_to_string_; |
- |
- // Cached value of type_to_atom_[ATOM_CHROME_WM_MESSAGE]. |
- Atom wm_message_atom_; |
- |
- // Handle to the WM. Used for sending messages. |
- XID wm_; |
- |
// The current value of the root window's _CHROME_LAYOUT_MODE property. |
WmIpcLayoutMode layout_mode_; |