diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-02 21:11:07 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-02 21:11:07 +0000 |
commit | f3bc59bc4de13a506717503aff161ffcb8cdbc6d (patch) | |
tree | 15cc5d986dbf0fab07ab139fce06e2592da67d41 /mojo/examples | |
parent | 8811093dd3446ca8b2a94602a78d1e76adfaed9d (diff) | |
download | chromium_src-f3bc59bc4de13a506717503aff161ffcb8cdbc6d.zip chromium_src-f3bc59bc4de13a506717503aff161ffcb8cdbc6d.tar.gz chromium_src-f3bc59bc4de13a506717503aff161ffcb8cdbc6d.tar.bz2 |
Revert 274322 "Implement a demo that shows one app embedding ren..."
> Implement a demo that shows one app embedding rendering in another.
>
> launcher inits the view manager, running the "window manager" app @ root.
> window manager embeds another app.
>
> R=sky@chromium.org
> TEST=mojo_shell --origin=http://127.0.0.1:4444 --disable-cache mojo:mojo_demo_launcher
> http://crbug.com/365012
>
> Review URL: https://codereview.chromium.org/303163005
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/306403003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274328 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples')
-rw-r--r-- | mojo/examples/demo_launcher/demo_launcher.cc | 43 | ||||
-rw-r--r-- | mojo/examples/embedded_app/embedded_app.cc | 40 | ||||
-rw-r--r-- | mojo/examples/sample_view_manager_app/sample_view_manager_app.cc | 5 | ||||
-rw-r--r-- | mojo/examples/window_manager/window_manager.cc | 51 |
4 files changed, 4 insertions, 135 deletions
diff --git a/mojo/examples/demo_launcher/demo_launcher.cc b/mojo/examples/demo_launcher/demo_launcher.cc deleted file mode 100644 index def2e4d..0000000 --- a/mojo/examples/demo_launcher/demo_launcher.cc +++ /dev/null @@ -1,43 +0,0 @@ -// 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. - -#include "base/basictypes.h" -#include "base/bind.h" -#include "base/run_loop.h" -#include "mojo/public/cpp/application/application.h" -#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" - -namespace mojo { -namespace examples { - -class DemoLauncher : public Application { - public: - DemoLauncher() {} - virtual ~DemoLauncher() {} - - private: - // Overridden from Application: - virtual void Initialize() MOJO_OVERRIDE { - ConnectTo<view_manager::IViewManagerInit>("mojo:mojo_view_manager", - &view_manager_init_); - view_manager_init_->Connect("mojo:mojo_window_manager", - base::Bind(&DemoLauncher::OnConnect, - base::Unretained(this))); - } - - void OnConnect(bool success) {} - - view_manager::IViewManagerInitPtr view_manager_init_; - - DISALLOW_COPY_AND_ASSIGN(DemoLauncher); -}; - -} // namespace examples - -// static -Application* Application::Create() { - return new examples::DemoLauncher; -} - -} // namespace mojo diff --git a/mojo/examples/embedded_app/embedded_app.cc b/mojo/examples/embedded_app/embedded_app.cc deleted file mode 100644 index 139e313..0000000 --- a/mojo/examples/embedded_app/embedded_app.cc +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -#include "base/basictypes.h" -#include "mojo/public/cpp/application/application.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" - -namespace mojo { -namespace examples { - -class EmbeddedApp : public Application { - public: - EmbeddedApp() {} - virtual ~EmbeddedApp() {} - - private: - // Overridden from Application: - virtual void Initialize() MOJO_OVERRIDE { - view_manager_ = new view_manager::ViewManager(this); - view_manager::View* view = view_manager::View::Create(view_manager_); - view_manager_->tree()->SetActiveView(view); - view->SetColor(SK_ColorYELLOW); - } - - view_manager::ViewManager* view_manager_; - - DISALLOW_COPY_AND_ASSIGN(EmbeddedApp); -}; - -} // namespace examples - -// static -Application* Application::Create() { - return new examples::EmbeddedApp; -} - -} // namespace mojo
\ No newline at end of file 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 15113bb..1ae5b90 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 @@ -36,7 +36,10 @@ class SampleApp : public Application { view_manager_->tree()->AddChild(node1); node1->AddChild(node11); - view11->SetColor(SK_ColorRED); + gfx::Canvas canvas(gfx::Size(800, 600), 1.0f, true); + canvas.DrawColor(SK_ColorRED); + view11->SetContents( + skia::GetTopDevice(*canvas.sk_canvas())->accessBitmap(true)); } private: diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc deleted file mode 100644 index 8aa52a3..0000000 --- a/mojo/examples/window_manager/window_manager.cc +++ /dev/null @@ -1,51 +0,0 @@ -// 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. - -#include "base/basictypes.h" -#include "mojo/public/cpp/application/application.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" - -namespace mojo { -namespace examples { - -class WindowManager : public Application { - public: - WindowManager() {} - virtual ~WindowManager() {} - - private: - // Overridden from Application: - virtual void Initialize() MOJO_OVERRIDE { - view_manager_ = new view_manager::ViewManager(this); - view_manager::ViewTreeNode* node = - view_manager::ViewTreeNode::Create(view_manager_); - view_manager_->tree()->AddChild(node); - node->SetBounds(gfx::Rect(800, 600)); - - view_manager::View* view = view_manager::View::Create(view_manager_); - node->SetActiveView(view); - view->SetColor(SK_ColorBLUE); - - view_manager::ViewTreeNode* embedded = - view_manager::ViewTreeNode::Create(view_manager_); - node->AddChild(embedded); - embedded->SetBounds(gfx::Rect(50, 50, 200, 200)); - view_manager_->Embed("mojo:mojo_embedded_app", embedded); - } - - view_manager::ViewManager* view_manager_; - - DISALLOW_COPY_AND_ASSIGN(WindowManager); -}; - -} // namespace examples - -// static -Application* Application::Create() { - return new examples::WindowManager; -} - -} // namespace mojo
\ No newline at end of file |