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

Unified Diff: views/widget/wm_ipc.h

Issue 8604012: move chromeos bubble setup code to window.cc (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: move functionality of wm ipc out of browser so that views/bubble can use it. Created 9 years, 1 month 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: views/widget/wm_ipc.h
diff --git a/chrome/browser/chromeos/legacy_window_manager/wm_ipc.h b/views/widget/wm_ipc.h
similarity index 81%
copy from chrome/browser/chromeos/legacy_window_manager/wm_ipc.h
copy to views/widget/wm_ipc.h
index d4a48b4bfe3531ad4e86cf3827ea16c2c623ad4c..9920e47838cba57bf5bd1cf4f55c7ccef196b458 100644
--- a/chrome/browser/chromeos/legacy_window_manager/wm_ipc.h
+++ b/views/widget/wm_ipc.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_LEGACY_WINDOW_MANAGER_WM_IPC_H_
-#define CHROME_BROWSER_CHROMEOS_LEGACY_WINDOW_MANAGER_WM_IPC_H_
+#ifndef VIEWS_WIDGET_WM_IPC_H_
+#define VIEWS_WIDGET_WM_IPC_H_
#pragma once
#include <gtk/gtk.h>
@@ -25,6 +25,8 @@ namespace gfx {
class Rect;
}
+namespace views {
+
namespace chromeos {
class WmIpc {
@@ -48,15 +50,15 @@ class WmIpc {
struct Message {
public:
Message() {
- Init(WM_IPC_MESSAGE_UNKNOWN);
+ Init(::chromeos::WM_IPC_MESSAGE_UNKNOWN);
}
// WmIpcMessageType is defined in chromeos_wm_ipc_enums.h.
- explicit Message(WmIpcMessageType type) {
+ explicit Message(::chromeos::WmIpcMessageType type) {
Init(type);
}
- WmIpcMessageType type() const { return type_; }
- void set_type(WmIpcMessageType type) { type_ = type; }
+ ::chromeos::WmIpcMessageType type() const { return type_; }
+ void set_type(::chromeos::WmIpcMessageType type) { type_ = type; }
inline int max_params() const {
return arraysize(params_);
@@ -74,7 +76,7 @@ class WmIpc {
private:
// Common initialization code shared between constructors.
- void Init(WmIpcMessageType type) {
+ void Init(::chromeos::WmIpcMessageType type) {
set_type(type);
for (int i = 0; i < max_params(); ++i) {
set_param(i, 0);
@@ -82,7 +84,7 @@ class WmIpc {
}
// Type of message that was sent.
- WmIpcMessageType type_;
+ ::chromeos::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
@@ -93,14 +95,12 @@ class WmIpc {
// Returns the single instance of WmIpc.
static WmIpc* instance();
- WmIpcLayoutMode layout_mode() const { return layout_mode_; }
-
// Gets or sets a property describing a window's type.
// WmIpcMessageType is defined in chromeos_wm_ipc_enums.h. Type-specific
// parameters may also be supplied. The caller is responsible for trapping
// errors from the X server.
bool SetWindowType(GtkWidget* widget,
- WmIpcWindowType type,
+ ::chromeos::WmIpcWindowType type,
const std::vector<int>* params);
// Gets the string name of an atom from the AtomType enum.
@@ -110,18 +110,20 @@ class WmIpc {
// caller is responsible for trapping errors from the X server. If
// the parameters are not interesting to the caller, NULL may be
// passed for |params|.
- WmIpcWindowType GetWindowType(GtkWidget* widget, std::vector<int>* params);
+ ::chromeos::WmIpcWindowType GetWindowType(GtkWidget* widget,
+ std::vector<int>* params);
// Gets the set of atoms contained in a window's _CHROME_STATE property.
// Returns false if the property isn't set.
bool GetWindowState(GtkWidget* widget, std::set<AtomType>* atom_types);
// Sends a message to the WM.
- void SendMessage(const Message& msg);
+ void SendMessage(const views::chromeos::WmIpc::Message& msg);
// If |event| is a valid Message it is decoded into |msg| and true is
// returned. If false is returned, |event| is not a valid Message.
- bool DecodeMessage(const GdkEventClient& event, Message* msg);
+ bool DecodeMessage(const GdkEventClient& event,
+ views::chromeos::WmIpc::Message* msg);
// Handles ClientMessage events that weren't decodable using DecodeMessage().
// Specifically, this catches messages about the WM_S0 selection that get sent
@@ -129,9 +131,6 @@ class WmIpc {
// See ICCCM 2.8 for more info about MANAGER selections.
void HandleNonChromeClientMessageEvent(const GdkEventClient& event);
- // Handle an event reporting a property change on the root window.
- void HandleRootWindowPropertyEvent(const GdkEventProperty& event);
-
// Sets a _CHROME_LOGGED_IN property on the root window describing whether
// the user is currently logged in or not.
void SetLoggedInProperty(bool logged_in);
@@ -143,6 +142,11 @@ class WmIpc {
// Sends a message to the window manager notifying it that we're signing out.
void NotifyAboutSignout();
+ // Accessor for type_to_atom map
+ std::map<AtomType, Atom>* type_to_atom() {
+ return &type_to_atom_;
+ }
+
private:
friend struct base::DefaultLazyInstanceTraits<WmIpc>;
@@ -154,10 +158,6 @@ class WmIpc {
// 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_;
@@ -170,12 +170,11 @@ class WmIpc {
// 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_;
-
DISALLOW_COPY_AND_ASSIGN(WmIpc);
};
} // namespace chromeos
+} // namespace views
+
#endif // CHROME_BROWSER_CHROMEOS_LEGACY_WINDOW_MANAGER_WM_IPC_H_
« ui/views/bubble/bubble_delegate.h ('K') | « views/views.gyp ('k') | views/widget/wm_ipc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698