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

Unified Diff: mojo/examples/sample_view_manager_app/sample_view_manager_app.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/examples/sample_view_manager_app/DEPS ('k') | mojo/mojo_services.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/sample_view_manager_app/sample_view_manager_app.cc
diff --git a/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc b/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc
index 549e2ed9dab5428d59014524b7c9d739da16491a..10d16a8c83254e8d8751e19ba377dadc5afb5c76 100644
--- a/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc
+++ b/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc
@@ -11,8 +11,10 @@
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/cpp/utility/run_loop.h"
+#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "mojo/services/public/cpp/view_manager/view_tree_node.h"
+#include "ui/gfx/canvas.h"
#if defined(WIN32)
#if !defined(CDECL)
@@ -37,7 +39,18 @@ class SampleApp : public Application {
view_manager::ViewTreeNode::Create(view_manager_.get());
view_manager::ViewTreeNode* node11 =
view_manager::ViewTreeNode::Create(view_manager_.get());
+ node11->SetBounds(gfx::Rect(800, 600));
+
+ view_manager::View* view11 =
+ view_manager::View::Create(view_manager_.get());
+ node11->SetActiveView(view11);
+ view_manager_->tree()->AddChild(node1);
node1->AddChild(node11);
+
+ gfx::Canvas canvas(gfx::Size(800, 600), 1.0f, true);
+ canvas.DrawColor(SK_ColorRED);
+ view11->SetContents(
+ skia::GetTopDevice(*canvas.sk_canvas())->accessBitmap(true));
}
virtual ~SampleApp() {
« no previous file with comments | « mojo/examples/sample_view_manager_app/DEPS ('k') | mojo/mojo_services.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698