summaryrefslogtreecommitdiffstats
path: root/ui/v2/src/view_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/v2/src/view_private.h')
-rw-r--r--ui/v2/src/view_private.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/ui/v2/src/view_private.h b/ui/v2/src/view_private.h
new file mode 100644
index 0000000..d59a34e
--- /dev/null
+++ b/ui/v2/src/view_private.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2013 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 UI_V2_SRC_VIEW_PRIVATE_H_
+#define UI_V2_SRC_VIEW_PRIVATE_H_
+
+#include "base/observer_list.h"
+#include "ui/v2/public/view.h"
+
+namespace gfx {
+class Rect;
+}
+
+namespace v2 {
+
+class ViewObserver;
+
+// Friend of View. Provides a way to access view state for the implementation
+// of class View.
+class ViewPrivate {
+ public:
+ explicit ViewPrivate(View* view);
+ ~ViewPrivate();
+
+ ObserverList<ViewObserver>* observers() { return &view_->observers_; }
+
+ void ClearParent() { view_->parent_ = NULL; }
+
+ void set_bounds(const gfx::Rect& bounds) { view_->bounds_ = bounds; }
+
+ private:
+ View* view_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewPrivate);
+};
+
+} // namespace v2
+
+#endif // UI_V2_SRC_VIEW_PRIVATE_H_