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

Side by Side Diff: mojo/services/public/cpp/view_manager/lib/view.cc

Issue 292813008: Implement SetViewContents in the client lib (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
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 #include "mojo/services/public/cpp/view_manager/view.h" 5 #include "mojo/services/public/cpp/view_manager/view.h"
6 6
7 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h" 7 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h"
8 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" 8 #include "mojo/services/public/cpp/view_manager/lib/view_private.h"
9 #include "mojo/services/public/cpp/view_manager/view_observer.h" 9 #include "mojo/services/public/cpp/view_manager/view_observer.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 void View::AddObserver(ViewObserver* observer) { 51 void View::AddObserver(ViewObserver* observer) {
52 observers_.AddObserver(observer); 52 observers_.AddObserver(observer);
53 } 53 }
54 54
55 void View::RemoveObserver(ViewObserver* observer) { 55 void View::RemoveObserver(ViewObserver* observer) {
56 observers_.RemoveObserver(observer); 56 observers_.RemoveObserver(observer);
57 } 57 }
58 58
59 void View::SetContents(const SkBitmap& contents) {
60 if (manager_)
61 ViewManagerPrivate(manager_).synchronizer()->SetViewContents(id_, contents);
62 }
63
59 View::View(ViewManager* manager) 64 View::View(ViewManager* manager)
60 : id_(ViewManagerPrivate(manager).synchronizer()->CreateView()), 65 : id_(ViewManagerPrivate(manager).synchronizer()->CreateView()),
61 node_(NULL), 66 node_(NULL),
62 manager_(manager) {} 67 manager_(manager) {}
63 68
64 View::View() 69 View::View()
65 : id_(-1), 70 : id_(-1),
66 node_(NULL), 71 node_(NULL),
67 manager_(NULL) {} 72 manager_(NULL) {}
68 73
69 View::~View() { 74 View::~View() {
70 ScopedDestructionNotifier notifier(this); 75 ScopedDestructionNotifier notifier(this);
71 if (manager_) 76 if (manager_)
72 ViewManagerPrivate(manager_).RemoveView(id_); 77 ViewManagerPrivate(manager_).RemoveView(id_);
73 } 78 }
74 79
75 void View::LocalDestroy() { 80 void View::LocalDestroy() {
76 delete this; 81 delete this;
77 } 82 }
78 83
79 } // namespace view_manager 84 } // namespace view_manager
80 } // namespace mojo 85 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/public/cpp/view_manager/lib/DEPS ('k') | mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698