OLD | NEW |
(Empty) | |
| 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 namespace mojo { |
| 8 namespace services { |
| 9 |
| 10 class NativeViewportAndroid : public NativeViewport { |
| 11 public: |
| 12 NativeViewportAndroid(NativeViewportDelegate* delegate) |
| 13 : delegate_(delegate) { |
| 14 } |
| 15 virtual ~NativeViewportAndroid() { |
| 16 } |
| 17 |
| 18 private: |
| 19 // Overridden from NativeViewport: |
| 20 virtual void Close() OVERRIDE { |
| 21 // TODO(beng): close activity containing MojoView? |
| 22 |
| 23 // TODO(beng): perform this in response to view destruction. |
| 24 delegate_->OnDestroyed(); |
| 25 } |
| 26 |
| 27 NativeViewportDelegate* delegate_; |
| 28 |
| 29 DISALLOW_COPY_AND_ASSIGN(NativeViewportAndroid); |
| 30 }; |
| 31 |
| 32 // static |
| 33 scoped_ptr<NativeViewport> NativeViewport::Create( |
| 34 NativeViewportDelegate* delegate) { |
| 35 return scoped_ptr<NativeViewport>(new NativeViewportAndroid(delegate)).Pass(); |
| 36 } |
| 37 |
| 38 } // namespace services |
| 39 } // namespace mojo |
OLD | NEW |