| Index: mojo/services/view_manager/server_view.h
|
| diff --git a/mojo/services/view_manager/node.h b/mojo/services/view_manager/server_view.h
|
| similarity index 41%
|
| rename from mojo/services/view_manager/node.h
|
| rename to mojo/services/view_manager/server_view.h
|
| index af140b9a8bbff4f0185496496cce3c494566133b..1895ee9a595c58571860eab73f70fb89ce0d6a04 100644
|
| --- a/mojo/services/view_manager/node.h
|
| +++ b/mojo/services/view_manager/server_view.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 MOJO_SERVICES_VIEW_MANAGER_NODE_H_
|
| -#define MOJO_SERVICES_VIEW_MANAGER_NODE_H_
|
| +#ifndef MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_
|
| +#define MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_
|
|
|
| #include <vector>
|
|
|
| @@ -17,39 +17,43 @@
|
| namespace mojo {
|
| namespace service {
|
|
|
| -class NodeDelegate;
|
| +class ServerViewDelegate;
|
|
|
| -// Represents a node in the graph. Delegate is informed of interesting events.
|
| +// Server side representation of a view. Delegate is informed of interesting
|
| +// events.
|
| //
|
| -// It is assumed that all functions that mutate the node tree have validated the
|
| -// value. For example, Reorder() assumes the supplied node is a child and not
|
| -// already in position.
|
| -class MOJO_VIEW_MANAGER_EXPORT Node {
|
| +// It is assumed that all functions that mutate the tree have validated the
|
| +// mutation is possible before hand. For example, Reorder() assumes the supplied
|
| +// view is a child and not already in position.
|
| +class MOJO_VIEW_MANAGER_EXPORT ServerView {
|
| public:
|
| - Node(NodeDelegate* delegate, const NodeId& id);
|
| - virtual ~Node();
|
| + ServerView(ServerViewDelegate* delegate, const ViewId& id);
|
| + virtual ~ServerView();
|
|
|
| - const NodeId& id() const { return id_; }
|
| + const ViewId& id() const { return id_; }
|
|
|
| - void Add(Node* child);
|
| - void Remove(Node* child);
|
| - void Reorder(Node* child, Node* relative, OrderDirection direction);
|
| + void Add(ServerView* child);
|
| + void Remove(ServerView* child);
|
| + void Reorder(ServerView* child,
|
| + ServerView* relative,
|
| + OrderDirection direction);
|
|
|
| const gfx::Rect& bounds() const { return bounds_; }
|
| void SetBounds(const gfx::Rect& bounds);
|
|
|
| - const Node* parent() const { return parent_; }
|
| - Node* parent() { return parent_; }
|
| + const ServerView* parent() const { return parent_; }
|
| + ServerView* parent() { return parent_; }
|
|
|
| - const Node* GetRoot() const;
|
| - Node* GetRoot() {
|
| - return const_cast<Node*>(const_cast<const Node*>(this)->GetRoot());
|
| + const ServerView* GetRoot() const;
|
| + ServerView* GetRoot() {
|
| + return const_cast<ServerView*>(
|
| + const_cast<const ServerView*>(this)->GetRoot());
|
| }
|
|
|
| - std::vector<const Node*> GetChildren() const;
|
| - std::vector<Node*> GetChildren();
|
| + std::vector<const ServerView*> GetChildren() const;
|
| + std::vector<ServerView*> GetChildren();
|
|
|
| - bool Contains(const Node* node) const;
|
| + bool Contains(const ServerView* view) const;
|
|
|
| // Returns true if the window is visible. This does not consider visibility
|
| // of any ancestors.
|
| @@ -60,23 +64,23 @@ class MOJO_VIEW_MANAGER_EXPORT Node {
|
| const SkBitmap& bitmap() const { return bitmap_; }
|
|
|
| private:
|
| - typedef std::vector<Node*> Nodes;
|
| + typedef std::vector<ServerView*> Views;
|
|
|
| - // Implementation of removing a node. Doesn't send any notification.
|
| - void RemoveImpl(Node* node);
|
| + // Implementation of removing a view. Doesn't send any notification.
|
| + void RemoveImpl(ServerView* view);
|
|
|
| - NodeDelegate* delegate_;
|
| - const NodeId id_;
|
| - Node* parent_;
|
| - Nodes children_;
|
| + ServerViewDelegate* delegate_;
|
| + const ViewId id_;
|
| + ServerView* parent_;
|
| + Views children_;
|
| bool visible_;
|
| gfx::Rect bounds_;
|
| SkBitmap bitmap_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(Node);
|
| + DISALLOW_COPY_AND_ASSIGN(ServerView);
|
| };
|
|
|
| } // namespace service
|
| } // namespace mojo
|
|
|
| -#endif // MOJO_SERVICES_VIEW_MANAGER_NODE_H_
|
| +#endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_
|
|
|