Chromium Code Reviews| Index: ash/surfaces/test_surface_overlay_view.h |
| diff --git a/ash/surfaces/test_surface_overlay_view.h b/ash/surfaces/test_surface_overlay_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e114c7a0cd81959ba156a4297acde9e7f79cad4b |
| --- /dev/null |
| +++ b/ash/surfaces/test_surface_overlay_view.h |
| @@ -0,0 +1,73 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_TEST_SURFACE_OVERLAY_SURFACE_OVERLAY_VIEW_H_ |
| +#define ASH_TEST_SURFACE_OVERLAY_SURFACE_OVERLAY_VIEW_H_ |
| + |
| +#include "ash/surfaces/surface_controller.h" |
| +#include "ash/wm/overlay_event_filter.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "ui/views/view.h" |
| +#include "ui/views/widget/widget.h" |
| +#include "ui/views/widget/widget_delegate.h" |
| + |
| +namespace cc { |
| +class ContentProvider; |
| +} |
| + |
| +namespace ui { |
| +class Layer; |
| +} |
| + |
| +namespace ash { |
| + |
| +class TestSurfaceOverlayView : public views::WidgetDelegateView, |
|
denniskempin (chromium)
2015/10/09 21:16:24
I know this code is WIP, just wanted to leave this
|
| + public OverlayEventFilter::Delegate, |
| + public SurfaceController::Observer { |
| + public: |
| + TestSurfaceOverlayView(); |
| + ~TestSurfaceOverlayView() override; |
| + |
| + // Overridden from ui::EventHandler: |
| + void OnKeyEvent(ui::KeyEvent* event) override; |
| + void OnMouseEvent(ui::MouseEvent* event) override; |
| + void OnScrollEvent(ui::ScrollEvent* event) override; |
| + void OnGestureEvent(ui::GestureEvent* event) override; |
| + |
| + // Overridden from views::View: |
| + void OnPaint(gfx::Canvas* canvas) override; |
| + |
| + // Overridden from views::WidgetDelegate: |
| + void WindowClosing() override; |
| + |
| + // Overridden from ash::OverlayEventFilter::Delegate: |
| + void Cancel() override; |
| + bool IsCancelingKeyEvent(ui::KeyEvent* event) override; |
| + aura::Window* GetWindow() override; |
| + |
| + // Overridden from SurfaceOverlayController::Observer: |
| + void OnTestSurfaceGpuMemoryBufferChanged() override; |
| + |
| + // Shows the test surface overlay. |
| + static void Show(); |
| + |
| + private: |
| + void TextureReleased(scoped_refptr<cc::ContextProvider> context_provider, |
| + unsigned image_id, |
| + unsigned texture_id, |
| + uint32 sync_point, |
| + bool is_lost); |
| + |
| + scoped_ptr<ui::Layer> test_surface_layer_; |
| + |
| + base::WeakPtrFactory<TestSurfaceOverlayView> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TestSurfaceOverlayView); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_SURFACES_TEST_SURFACE_OVERLAY_VIEW_H_ |