blob: b88ec8e909d5e77463bbba5e7d9a87f21d8380ff [file] [log] [blame]
// 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 "mojo/public/cpp/system/core.h"
namespace mojo {
class ApplicationDelegate;
// A utility for running an Application. The typical use case is to use
// when writing your MojoMain:
// MojoResult MojoMain(MojoHandle shell_handle) {
// mojo::ApplicationRunner runner(new MyApplicationDelegate());
// return runner.Run(shell_handle);
// }
// ApplicationRunner takes care of mojo environment initialization and
// shutdown, and starting a RunLoop from which your application can run and
// ultimately Quit().
class ApplicationRunner {
// Takes ownership of |delegate|.
explicit ApplicationRunner(ApplicationDelegate* delegate);
// Once the various parameters have been set above, use Run to initialize an
// ApplicationImpl wired to the provided delegate, and run a RunLoop until
// the application exits.
MojoResult Run(MojoHandle shell_handle);
ApplicationDelegate* delegate_;
} // namespace mojo