| Index: components/mus/example/client/client_application_delegate.cc
|
| diff --git a/components/mus/example/client/client_application_delegate.cc b/components/mus/example/client/client_application_delegate.cc
|
| index e73d4a49565ee6990c3b5076dfe4c71e9fc02e3e..c7fbe8878008faa4d3367f2367eca90d0d72f6c0 100644
|
| --- a/components/mus/example/client/client_application_delegate.cc
|
| +++ b/components/mus/example/client/client_application_delegate.cc
|
| @@ -4,14 +4,9 @@
|
|
|
| #include "components/mus/example/client/client_application_delegate.h"
|
|
|
| -#include "components/mus/example/wm/wm.mojom.h"
|
| -#include "components/mus/public/cpp/view_tree_connection.h"
|
| -#include "components/mus/public/cpp/view_tree_host_factory.h"
|
| -#include "mandoline/ui/aura/aura_init.h"
|
| -#include "mandoline/ui/aura/native_widget_view_manager.h"
|
| +#include "components/mus/example/common/mus_views_init.h"
|
| #include "mojo/application/public/cpp/application_connection.h"
|
| #include "mojo/application/public/cpp/application_impl.h"
|
| -#include "mojo/converters/geometry/geometry_type_converters.h"
|
| #include "ui/views/background.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/widget/widget_delegate.h"
|
| @@ -23,15 +18,15 @@ ClientApplicationDelegate::~ClientApplicationDelegate() {}
|
| void ClientApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
|
| app_ = app;
|
|
|
| - mojom::WMPtr wm;
|
| - mojo::URLRequestPtr request(mojo::URLRequest::New());
|
| - request->url = "mojo:example_wm";
|
| - app->ConnectToService(request.Pass(), &wm);
|
| + mus_views_init_.reset(new MUSViewsInit(app));
|
|
|
| for (int i = 0; i < 3; ++i) {
|
| - mojo::ViewTreeClientPtr view_tree_client;
|
| - mus::ViewTreeConnection::Create(this, GetProxy(&view_tree_client).Pass());
|
| - wm->OpenWindow(view_tree_client.Pass());
|
| + views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
|
| + widget_delegate->GetContentsView()->set_background(
|
| + views::Background::CreateSolidBackground(0xFFDDDDDD));
|
| +
|
| + views::Widget* widget = views::Widget::CreateWindow(widget_delegate);
|
| + widget->Show();
|
| }
|
| }
|
|
|
| @@ -39,28 +34,3 @@ bool ClientApplicationDelegate::ConfigureIncomingConnection(
|
| mojo::ApplicationConnection* connection) {
|
| return false;
|
| }
|
| -
|
| -void ClientApplicationDelegate::OnEmbed(mus::View* root) {
|
| - if (!aura_init_) {
|
| - aura_init_.reset(
|
| - new mandoline::AuraInit(root, app_->shell(), "example_resources.pak"));
|
| - }
|
| -
|
| - views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
|
| - widget_delegate->GetContentsView()->set_background(
|
| - views::Background::CreateSolidBackground(0xFFDDDDDD));
|
| -
|
| - views::Widget* widget = new views::Widget;
|
| - views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
|
| - params.delegate = widget_delegate;
|
| - params.native_widget =
|
| - new mandoline::NativeWidgetViewManager(widget, app_->shell(), root);
|
| - params.bounds = root->bounds().To<gfx::Rect>();
|
| - params.bounds.set_x(0);
|
| - params.bounds.set_y(0);
|
| - widget->Init(params);
|
| - widget->Show();
|
| -}
|
| -
|
| -void ClientApplicationDelegate::OnConnectionLost(
|
| - mus::ViewTreeConnection* connection) {}
|
|
|