OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 #ifndef ASH_TEST_SURFACE_OVERLAY_SURFACE_OVERLAY_VIEW_H_ | |
6 #define ASH_TEST_SURFACE_OVERLAY_SURFACE_OVERLAY_VIEW_H_ | |
7 | |
8 #include "ash/surfaces/surface_controller.h" | |
9 #include "ash/wm/overlay_event_filter.h" | |
10 #include "base/compiler_specific.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "ui/views/view.h" | |
14 #include "ui/views/widget/widget.h" | |
15 #include "ui/views/widget/widget_delegate.h" | |
16 | |
17 namespace cc { | |
18 class ContentProvider; | |
19 } | |
20 | |
21 namespace ui { | |
22 class Layer; | |
23 } | |
24 | |
25 namespace ash { | |
26 | |
27 class TestSurfaceOverlayView : public views::WidgetDelegateView, | |
denniskempin (chromium)
2015/10/09 21:16:24
I know this code is WIP, just wanted to leave this
| |
28 public OverlayEventFilter::Delegate, | |
29 public SurfaceController::Observer { | |
30 public: | |
31 TestSurfaceOverlayView(); | |
32 ~TestSurfaceOverlayView() override; | |
33 | |
34 // Overridden from ui::EventHandler: | |
35 void OnKeyEvent(ui::KeyEvent* event) override; | |
36 void OnMouseEvent(ui::MouseEvent* event) override; | |
37 void OnScrollEvent(ui::ScrollEvent* event) override; | |
38 void OnGestureEvent(ui::GestureEvent* event) override; | |
39 | |
40 // Overridden from views::View: | |
41 void OnPaint(gfx::Canvas* canvas) override; | |
42 | |
43 // Overridden from views::WidgetDelegate: | |
44 void WindowClosing() override; | |
45 | |
46 // Overridden from ash::OverlayEventFilter::Delegate: | |
47 void Cancel() override; | |
48 bool IsCancelingKeyEvent(ui::KeyEvent* event) override; | |
49 aura::Window* GetWindow() override; | |
50 | |
51 // Overridden from SurfaceOverlayController::Observer: | |
52 void OnTestSurfaceGpuMemoryBufferChanged() override; | |
53 | |
54 // Shows the test surface overlay. | |
55 static void Show(); | |
56 | |
57 private: | |
58 void TextureReleased(scoped_refptr<cc::ContextProvider> context_provider, | |
59 unsigned image_id, | |
60 unsigned texture_id, | |
61 uint32 sync_point, | |
62 bool is_lost); | |
63 | |
64 scoped_ptr<ui::Layer> test_surface_layer_; | |
65 | |
66 base::WeakPtrFactory<TestSurfaceOverlayView> weak_ptr_factory_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(TestSurfaceOverlayView); | |
69 }; | |
70 | |
71 } // namespace ash | |
72 | |
73 #endif // ASH_SURFACES_TEST_SURFACE_OVERLAY_VIEW_H_ | |
OLD | NEW |