Index: mojo/services/public/cpp/view_manager/view.h |
diff --git a/mojo/services/public/cpp/view_manager/node.h b/mojo/services/public/cpp/view_manager/view.h |
similarity index 61% |
rename from mojo/services/public/cpp/view_manager/node.h |
rename to mojo/services/public/cpp/view_manager/view.h |
index be430ad7ffc508d39a8edfbe78c0c549f16611a8..bc8bcd5e302761a855d903b11d2dab44d63622f1 100644 |
--- a/mojo/services/public/cpp/view_manager/node.h |
+++ b/mojo/services/public/cpp/view_manager/view.h |
@@ -1,9 +1,9 @@ |
-// Copyright 2014 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
-#ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_ |
-#define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_ |
+#ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_H_ |
+#define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_H_ |
#include <vector> |
@@ -23,19 +23,19 @@ namespace mojo { |
class ServiceProviderImpl; |
class View; |
class ViewManager; |
-class NodeObserver; |
+class ViewObserver; |
-// Nodes are owned by the ViewManager. |
-// TODO(beng): Right now, you'll have to implement a NodeObserver to track |
+// Views are owned by the ViewManager. |
+// TODO(beng): Right now, you'll have to implement a ViewObserver to track |
// destruction and NULL any pointers you have. |
// Investigate some kind of smart pointer or weak pointer for these. |
-class Node { |
+class View { |
public: |
- typedef std::vector<Node*> Children; |
+ typedef std::vector<View*> Children; |
- static Node* Create(ViewManager* view_manager); |
+ static View* Create(ViewManager* view_manager); |
- // Destroys this node and all its children. |
+ // Destroys this view and all its children. |
void Destroy(); |
// Configuration. |
@@ -50,24 +50,24 @@ class Node { |
// TODO(sky): add accessor. |
// Observation. |
- void AddObserver(NodeObserver* observer); |
- void RemoveObserver(NodeObserver* observer); |
+ void AddObserver(ViewObserver* observer); |
+ void RemoveObserver(ViewObserver* observer); |
// Tree. |
- Node* parent() { return parent_; } |
- const Node* parent() const { return parent_; } |
+ View* parent() { return parent_; } |
+ const View* parent() const { return parent_; } |
const Children& children() const { return children_; } |
- void AddChild(Node* child); |
- void RemoveChild(Node* child); |
+ void AddChild(View* child); |
+ void RemoveChild(View* child); |
- void Reorder(Node* relative, OrderDirection direction); |
+ void Reorder(View* relative, OrderDirection direction); |
void MoveToFront(); |
void MoveToBack(); |
- bool Contains(Node* child) const; |
+ bool Contains(View* child) const; |
- Node* GetChildById(Id id); |
+ View* GetChildById(Id id); |
// TODO(beng): temporary only. |
void SetContents(const SkBitmap& contents); |
@@ -84,34 +84,34 @@ class Node { |
protected: |
// This class is subclassed only by test classes that provide a public ctor. |
- Node(); |
- ~Node(); |
+ View(); |
+ ~View(); |
private: |
- friend class NodePrivate; |
+ friend class ViewPrivate; |
friend class ViewManagerClientImpl; |
- explicit Node(ViewManager* manager); |
+ explicit View(ViewManager* manager); |
void LocalDestroy(); |
- void LocalAddChild(Node* child); |
- void LocalRemoveChild(Node* child); |
+ void LocalAddChild(View* child); |
+ void LocalRemoveChild(View* child); |
// Returns true if the order actually changed. |
- bool LocalReorder(Node* relative, OrderDirection direction); |
+ bool LocalReorder(View* relative, OrderDirection direction); |
void LocalSetBounds(const gfx::Rect& old_bounds, const gfx::Rect& new_bounds); |
ViewManager* manager_; |
Id id_; |
- Node* parent_; |
+ View* parent_; |
Children children_; |
- ObserverList<NodeObserver> observers_; |
+ ObserverList<ViewObserver> observers_; |
gfx::Rect bounds_; |
- DISALLOW_COPY_AND_ASSIGN(Node); |
+ DISALLOW_COPY_AND_ASSIGN(View); |
}; |
} // namespace mojo |
-#endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_NODE_H_ |
+#endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_H_ |