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

Side by Side Diff: mojo/services/view_manager/view.h

Issue 272833002: View synchronization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/view_manager/root_node_manager.cc ('k') | mojo/services/view_manager/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_H_ 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_H_ 6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "mojo/services/view_manager/ids.h" 11 #include "mojo/services/view_manager/ids.h"
12 #include "mojo/services/view_manager/view_manager_export.h" 12 #include "mojo/services/view_manager/view_manager_export.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 13 #include "third_party/skia/include/core/SkBitmap.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace services { 16 namespace services {
17 namespace view_manager { 17 namespace view_manager {
18
19 class Node; 18 class Node;
19 namespace service {
20 20
21 // Represents a view. A view may be associated with a single Node. 21 // Represents a view. A view may be associated with a single Node.
22 class MOJO_VIEW_MANAGER_EXPORT View { 22 class MOJO_VIEW_MANAGER_EXPORT View {
23 public: 23 public:
24 explicit View(const ViewId& id); 24 explicit View(const ViewId& id);
25 ~View(); 25 ~View();
26 26
27 const ViewId& id() const { return id_; } 27 const ViewId& id() const { return id_; }
28 28
29 Node* node() { return node_; } 29 Node* node() { return node_; }
30 30
31 void SetBitmap(const SkBitmap& contents); 31 void SetBitmap(const SkBitmap& contents);
32 const SkBitmap& bitmap() const { return bitmap_; } 32 const SkBitmap& bitmap() const { return bitmap_; }
33 33
34 private: 34 private:
35 // Node is responsible for maintaining |node_|. 35 // Node is responsible for maintaining |node_|.
36 friend class Node; 36 friend class mojo::services::view_manager::Node;
37 37
38 void set_node(Node* node) { node_ = node; } 38 void set_node(Node* node) { node_ = node; }
39 39
40 const ViewId id_; 40 const ViewId id_;
41 Node* node_; 41 Node* node_;
42 SkBitmap bitmap_; 42 SkBitmap bitmap_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(View); 44 DISALLOW_COPY_AND_ASSIGN(View);
45 }; 45 };
46 46
47 } // namespace service
47 } // namespace view_manager 48 } // namespace view_manager
48 } // namespace services 49 } // namespace services
49 } // namespace mojo 50 } // namespace mojo
50 51
51 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_H_ 52 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_H_
OLDNEW
« no previous file with comments | « mojo/services/view_manager/root_node_manager.cc ('k') | mojo/services/view_manager/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698