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