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

Unified Diff: mojo/services/view_manager/public/cpp/view.h

Issue 795593004: Update mojo sdk to rev cc531b32182099a5a034a99daff35ed5d38a61c8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More workarounds for MSVC Created 6 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/public/cpp/view.h
diff --git a/mojo/services/view_manager/public/cpp/view.h b/mojo/services/view_manager/public/cpp/view.h
index 8569616aefb5802e963de67fd02d76887b8d5c9f..3222b330f08bd5dc2de26a09ee5210596ebc68bd 100644
--- a/mojo/services/view_manager/public/cpp/view.h
+++ b/mojo/services/view_manager/public/cpp/view.h
@@ -34,10 +34,7 @@ struct ViewProperty;
class View {
public:
using Children = std::vector<View*>;
-
- // Creates and returns a new View (which is owned by the ViewManager). Views
- // are initially hidden, use SetVisible(true) to show.
- static View* Create(ViewManager* view_manager);
+ using SharedProperties = std::map<std::string, std::vector<uint8_t>>;
// Destroys this view and all its children.
void Destroy();
@@ -57,9 +54,7 @@ class View {
// Returns the set of string to bag of byte properties. These properties are
// shared with the view manager.
- const std::map<std::string, std::vector<uint8_t>>& shared_properties() const {
- return properties_;
- }
+ const SharedProperties& shared_properties() const { return properties_; }
// Sets a property. If |data| is null, this property is deleted.
void SetSharedProperty(const std::string& name,
const std::vector<uint8_t>* data);
@@ -103,6 +98,9 @@ class View {
View* parent() { return parent_; }
const View* parent() const { return parent_; }
const Children& children() const { return children_; }
+ View* GetRoot() {
+ return const_cast<View*>(const_cast<const View*>(this)->GetRoot());
+ }
const View* GetRoot() const;
void AddChild(View* child);
@@ -136,7 +134,7 @@ class View {
friend class ViewPrivate;
friend class ViewManagerClientImpl;
- explicit View(ViewManager* manager);
+ View(ViewManager* manager, Id id);
// Called by the public {Set,Get,Clear}Property functions.
int64 SetLocalPropertyInternal(const void* key,
@@ -177,7 +175,7 @@ class View {
bool visible_;
- std::map<std::string, std::vector<uint8_t>> properties_;
+ SharedProperties properties_;
// Drawn state is derived from the visible state and the parent's visible
// state. This field is only used if the view has no parent (eg it's a root).

Powered by Google App Engine
This is Rietveld 408576698