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

Unified Diff: mojo/services/view_manager/cpp/lib/view_private.h

Issue 1536713004: Revert "Delete the ViewManager and WindowManager services." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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: mojo/services/view_manager/cpp/lib/view_private.h
diff --git a/mojo/services/view_manager/cpp/lib/view_private.h b/mojo/services/view_manager/cpp/lib/view_private.h
new file mode 100644
index 0000000000000000000000000000000000000000..731c678bb2222169f2f82f6576ae202c7356c870
--- /dev/null
+++ b/mojo/services/view_manager/cpp/lib/view_private.h
@@ -0,0 +1,63 @@
+// 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_VIEW_MANAGER_CPP_LIB_VIEW_PRIVATE_H_
+#define MOJO_SERVICES_VIEW_MANAGER_CPP_LIB_VIEW_PRIVATE_H_
+
+#include "view_manager/cpp/view.h"
+
+namespace mojo {
+
+// This class is a friend of a View and contains functions to mutate internal
+// state of View.
+class ViewPrivate {
+ public:
+ explicit ViewPrivate(View* view);
+ ~ViewPrivate();
+
+ // Creates and returns a new View. Caller owns the return value.
+ static View* LocalCreate();
+
+ base::ObserverList<ViewObserver>* observers() { return &view_->observers_; }
+
+ void ClearParent() { view_->parent_ = NULL; }
+
+ void set_visible(bool visible) { view_->visible_ = visible; }
+
+ void set_drawn(bool drawn) { view_->drawn_ = drawn; }
+
+ void set_id(Id id) { view_->id_ = id; }
+
+ void set_view_manager(ViewManager* manager) { view_->manager_ = manager; }
+
+ void set_properties(const std::map<std::string, std::vector<uint8_t>>& data) {
+ view_->properties_ = data;
+ }
+
+ void LocalSetViewportMetrics(const ViewportMetrics& old_metrics,
+ const ViewportMetrics& new_metrics) {
+ view_->LocalSetViewportMetrics(new_metrics, new_metrics);
+ }
+
+ void LocalDestroy() { view_->LocalDestroy(); }
+ void LocalAddChild(View* child) { view_->LocalAddChild(child); }
+ void LocalRemoveChild(View* child) { view_->LocalRemoveChild(child); }
+ void LocalReorder(View* relative, OrderDirection direction) {
+ view_->LocalReorder(relative, direction);
+ }
+ void LocalSetBounds(const Rect& old_bounds, const Rect& new_bounds) {
+ view_->LocalSetBounds(old_bounds, new_bounds);
+ }
+ void LocalSetDrawn(bool drawn) { view_->LocalSetDrawn(drawn); }
+ void LocalSetVisible(bool visible) { view_->LocalSetVisible(visible); }
+
+ private:
+ View* view_;
+
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ViewPrivate);
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_VIEW_MANAGER_CPP_LIB_VIEW_PRIVATE_H_
« no previous file with comments | « mojo/services/view_manager/cpp/lib/view_observer.cc ('k') | mojo/services/view_manager/cpp/lib/view_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698