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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/content_export.h"
10 #include "ui/gfx/native_widget_types.h"
24 class GLContextLostListener
;
26 class ImageTransportFactoryAndroidObserver
{
28 virtual ~ImageTransportFactoryAndroidObserver() {}
29 virtual void OnLostResources() = 0;
32 class CONTENT_EXPORT ImageTransportFactoryAndroid
{
34 virtual ~ImageTransportFactoryAndroid();
36 // Initializes the global transport factory for unit tests.
37 static void InitializeForUnitTests(
38 scoped_ptr
<ImageTransportFactoryAndroid
> test_factory
);
39 // Terminates the global transport factory for unit tests.
40 static void TerminateForUnitTests();
42 static ImageTransportFactoryAndroid
* GetInstance();
44 virtual GLHelper
* GetGLHelper() = 0;
45 virtual uint32
GetChannelID() = 0;
47 static void AddObserver(ImageTransportFactoryAndroidObserver
* observer
);
48 static void RemoveObserver(ImageTransportFactoryAndroidObserver
* observer
);
51 ImageTransportFactoryAndroid();
53 scoped_ptr
<GLContextLostListener
> context_lost_listener_
;
56 } // namespace content
58 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_