summaryrefslogtreecommitdiffstats
path: root/mash/example/views_examples/views_examples_application_delegate.cc
blob: 8bc5678db2348e8c0ff505ae622ed7f62b35119d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2015 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 "mash/example/views_examples/views_examples_application_delegate.h"

#include "mojo/shell/public/cpp/connection.h"
#include "mojo/shell/public/cpp/connector.h"
#include "ui/views/examples/example_base.h"
#include "ui/views/examples/examples_window.h"
#include "ui/views/mus/aura_init.h"
#include "ui/views/mus/window_manager_connection.h"

ViewsExamplesApplicationDelegate::ViewsExamplesApplicationDelegate() {}

ViewsExamplesApplicationDelegate::~ViewsExamplesApplicationDelegate() {
}

void ViewsExamplesApplicationDelegate::Initialize(
    mojo::Connector* connector,
    const mojo::Identity& identity,
    uint32_t id) {
  tracing_.Initialize(connector, identity.name());
  aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak"));

  views::WindowManagerConnection::Create(connector);

  views::examples::ShowExamplesWindow(views::examples::DO_NOTHING_ON_CLOSE,
                                      nullptr, nullptr);
}

bool ViewsExamplesApplicationDelegate::AcceptConnection(
    mojo::Connection* connection) {
  return false;
}