| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" | 10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 // NativeViewportClient implementation. | 49 // NativeViewportClient implementation. |
| 50 virtual void OnCreated() OVERRIDE { | 50 virtual void OnCreated() OVERRIDE { |
| 51 ppapi::ProxyAutoLock lock; | 51 ppapi::ProxyAutoLock lock; |
| 52 | 52 |
| 53 plugin_instance_ = plugin_module_->CreateInstance().Pass(); | 53 plugin_instance_ = plugin_module_->CreateInstance().Pass(); |
| 54 if (!plugin_instance_->DidCreate()) | 54 if (!plugin_instance_->DidCreate()) |
| 55 plugin_instance_.reset(); | 55 plugin_instance_.reset(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual void OnDestroyed() OVERRIDE { | 58 virtual void OnDestroyed(const mojo::Callback<void()>& callback) OVERRIDE { |
| 59 ppapi::ProxyAutoLock lock; | 59 ppapi::ProxyAutoLock lock; |
| 60 | 60 |
| 61 if (plugin_instance_) { | 61 if (plugin_instance_) { |
| 62 plugin_instance_->DidDestroy(); | 62 plugin_instance_->DidDestroy(); |
| 63 plugin_instance_.reset(); | 63 plugin_instance_.reset(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 base::MessageLoop::current()->Quit(); | 66 base::MessageLoop::current()->Quit(); |
| 67 callback.Run(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE { | 70 virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE { |
| 70 ppapi::ProxyAutoLock lock; | 71 ppapi::ProxyAutoLock lock; |
| 71 | 72 |
| 72 if (plugin_instance_) | 73 if (plugin_instance_) |
| 73 plugin_instance_->DidChangeView(bounds.To<PP_Rect>()); | 74 plugin_instance_->DidChangeView(bounds.To<PP_Rect>()); |
| 74 } | 75 } |
| 75 | 76 |
| 76 virtual void OnEvent(EventPtr event, | 77 virtual void OnEvent(EventPtr event, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 } // namespace examples | 104 } // namespace examples |
| 104 | 105 |
| 105 // static | 106 // static |
| 106 ApplicationDelegate* ApplicationDelegate::Create() { | 107 ApplicationDelegate* ApplicationDelegate::Create() { |
| 107 return new examples::PepperContainerApp(); | 108 return new examples::PepperContainerApp(); |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace mojo | 111 } // namespace mojo |
| OLD | NEW |