| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_ANDROID_DRAW_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_DRAW_DELEGATE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_DRAW_DELEGATE_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_DRAW_DELEGATE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/public/browser/android/draw_delegate.h" | 9 #include "content/public/browser/android/draw_delegate.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class DrawDelegateImpl : public DrawDelegate { | 15 class DrawDelegateImpl : public DrawDelegate { |
| 16 public: | 16 public: |
| 17 static DrawDelegateImpl* GetInstance(); | 17 static DrawDelegateImpl* GetInstance(); |
| 18 DrawDelegateImpl(); | 18 DrawDelegateImpl(); |
| 19 virtual ~DrawDelegateImpl(); | 19 virtual ~DrawDelegateImpl(); |
| 20 | 20 |
| 21 // DrawDelegate implementation. | 21 // DrawDelegate implementation. |
| 22 virtual void SetUpdateCallback( | |
| 23 const SurfaceUpdatedCallback& callback) OVERRIDE; | |
| 24 virtual void SetBounds(const gfx::Size& size) OVERRIDE; | 22 virtual void SetBounds(const gfx::Size& size) OVERRIDE; |
| 25 | |
| 26 void OnSurfaceUpdated(uint64 texture, RenderWidgetHostView* view, | |
| 27 const SurfacePresentedCallback& present_callback); | |
| 28 gfx::Size GetBounds() { return size_; } | 23 gfx::Size GetBounds() { return size_; } |
| 29 | 24 |
| 30 protected: | 25 protected: |
| 31 SurfaceUpdatedCallback draw_callback_; | |
| 32 gfx::Size size_; | 26 gfx::Size size_; |
| 33 | 27 |
| 34 DISALLOW_COPY_AND_ASSIGN(DrawDelegateImpl); | 28 DISALLOW_COPY_AND_ASSIGN(DrawDelegateImpl); |
| 35 }; | 29 }; |
| 36 | 30 |
| 37 } // namespace content | 31 } // namespace content |
| 38 | 32 |
| 39 #endif // CONTENT_BROWSER_ANDROID_DRAW_DELEGATE_IMPL_H_ | 33 #endif // CONTENT_BROWSER_ANDROID_DRAW_DELEGATE_IMPL_H_ |
| OLD | NEW |