1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_INIT_SERVICE_IMPL_H_
6#define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_INIT_SERVICE_IMPL_H_
7
8#include <string>
9
10#include "base/basictypes.h"
11#include "base/compiler_specific.h"
12#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
13#include "mojo/services/view_manager/connection_manager.h"
14#include "mojo/services/view_manager/view_manager_export.h"
15
16namespace mojo {
17
18class ApplicationConnection;
19
20namespace service {
21
22class ViewManagerInitServiceContext;
23
24#if defined(OS_WIN)
25// Equivalent of NON_EXPORTED_BASE which does not work with the template snafu
26// below.
27#pragma warning(push)
28#pragma warning(disable : 4275)
29#endif
30
31// Used to create the initial ViewManagerClient. Doesn't initiate the Connect()
32// until the WindowTreeHost has been created.
33class MOJO_VIEW_MANAGER_EXPORT ViewManagerInitServiceImpl
34    : public InterfaceImpl<ViewManagerInitService> {
35 public:
36  ViewManagerInitServiceImpl(ApplicationConnection* connection,
37                             ViewManagerInitServiceContext* context);
38  virtual ~ViewManagerInitServiceImpl();
39
40 private:
41  // ViewManagerInitService overrides:
42  virtual void Embed(const String& url,
43                     ServiceProviderPtr service_provider,
44                     const Callback<void(bool)>& callback) OVERRIDE;
45
46  ViewManagerInitServiceContext* context_;
47
48  DISALLOW_COPY_AND_ASSIGN(ViewManagerInitServiceImpl);
49};
50
51#if defined(OS_WIN)
52#pragma warning(pop)
53#endif
54
55}  // namespace service
56}  // namespace mojo
57
58#endif  // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_INIT_SERVICE_IMPL_H_
59