platform_viewport_stub.cc revision 6e8cce623b6e4fe0c9e4af605d675dd9d0338c38
1// Copyright 2013 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#include "mojo/services/native_viewport/platform_viewport.h"
6
7// Stub to build on platforms we don't fully support yet.
8
9namespace mojo {
10
11class PlatformViewportStub : public PlatformViewport {
12 public:
13  PlatformViewportStub(Delegate* delegate) : delegate_(delegate) {
14  }
15  virtual ~PlatformViewportStub() {
16  }
17
18 private:
19  // Overridden from PlatformViewport:
20  virtual void Init() OVERRIDE {
21  }
22  virtual void Show() OVERRIDE {
23  }
24  virtual void Hide() OVERRIDE {
25  }
26  virtual void Close() OVERRIDE {
27    delegate_->OnDestroyed();
28  }
29  virtual gfx::Size GetSize() OVERRIDE {
30    return gfx::Size();
31  }
32  virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {
33  }
34
35  Delegate* delegate_;
36
37  DISALLOW_COPY_AND_ASSIGN(PlatformViewportStub);
38};
39
40// static
41scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) {
42  return scoped_ptr<PlatformViewport>(
43      new PlatformViewportStub(delegate)).Pass();
44}
45
46}  // namespace mojo
47