Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: ui/aura/window_delegate.h

Issue 1053143002: Make View::Paint use ui::PaintRecorder to access PaintContext's canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paintrecorder: . Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 UI_AURA_WINDOW_DELEGATE_H_ 5 #ifndef UI_AURA_WINDOW_DELEGATE_H_
6 #define UI_AURA_WINDOW_DELEGATE_H_ 6 #define UI_AURA_WINDOW_DELEGATE_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "ui/aura/aura_export.h" 10 #include "ui/aura/aura_export.h"
11 #include "ui/events/event_constants.h" 11 #include "ui/events/event_constants.h"
12 #include "ui/events/event_handler.h" 12 #include "ui/events/event_handler.h"
13 #include "ui/gfx/native_widget_types.h" 13 #include "ui/gfx/native_widget_types.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 class Canvas; 16 class Canvas;
17 class Path; 17 class Path;
18 class Point; 18 class Point;
19 class Rect; 19 class Rect;
20 class Size; 20 class Size;
21 } 21 }
22 22
23 namespace ui { 23 namespace ui {
24 class GestureEvent; 24 class GestureEvent;
25 class KeyEvent; 25 class KeyEvent;
26 class Layer; 26 class Layer;
27 class MouseEvent; 27 class MouseEvent;
28 class PaintContext;
28 class TextInputClient; 29 class TextInputClient;
29 class Texture; 30 class Texture;
30 class TouchEvent; 31 class TouchEvent;
31 } 32 }
32 33
33 namespace aura { 34 namespace aura {
34 35
35 // Delegate interface for aura::Window. 36 // Delegate interface for aura::Window.
36 class AURA_EXPORT WindowDelegate : public ui::EventHandler { 37 class AURA_EXPORT WindowDelegate : public ui::EventHandler {
37 public: 38 public:
(...skipping 24 matching lines...) Expand all
62 virtual bool ShouldDescendIntoChildForEventHandling( 63 virtual bool ShouldDescendIntoChildForEventHandling(
63 Window* child, 64 Window* child,
64 const gfx::Point& location) = 0; 65 const gfx::Point& location) = 0;
65 66
66 // Returns true of the window can be focused. 67 // Returns true of the window can be focused.
67 virtual bool CanFocus() = 0; 68 virtual bool CanFocus() = 0;
68 69
69 // Invoked when mouse capture is lost on the window. 70 // Invoked when mouse capture is lost on the window.
70 virtual void OnCaptureLost() = 0; 71 virtual void OnCaptureLost() = 0;
71 72
72 // Asks the delegate to paint window contents into the supplied canvas. 73 // Asks the delegate to paint window contents into the supplied context.
73 virtual void OnPaint(gfx::Canvas* canvas) = 0; 74 virtual void OnPaint(const ui::PaintContext& context) = 0;
74 75
75 // Called when the window's device scale factor has changed. 76 // Called when the window's device scale factor has changed.
76 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; 77 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0;
77 78
78 // Called from Window's destructor before OnWindowDestroyed and before the 79 // Called from Window's destructor before OnWindowDestroyed and before the
79 // children have been destroyed and the window has been removed from its 80 // children have been destroyed and the window has been removed from its
80 // parent. 81 // parent.
81 // This method takes the window because the delegate implementation may no 82 // This method takes the window because the delegate implementation may no
82 // longer have a route back to the window by the time this method is called. 83 // longer have a route back to the window by the time this method is called.
83 virtual void OnWindowDestroying(Window* window) = 0; 84 virtual void OnWindowDestroying(Window* window) = 0;
(...skipping 21 matching lines...) Expand all
105 // above returns true. 106 // above returns true.
106 virtual void GetHitTestMask(gfx::Path* mask) const = 0; 107 virtual void GetHitTestMask(gfx::Path* mask) const = 0;
107 108
108 protected: 109 protected:
109 ~WindowDelegate() override {} 110 ~WindowDelegate() override {}
110 }; 111 };
111 112
112 } // namespace aura 113 } // namespace aura
113 114
114 #endif // UI_AURA_WINDOW_DELEGATE_H_ 115 #endif // UI_AURA_WINDOW_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/aura/window.cc ('k') | ui/aura/window_unittest.cc » ('j') | ui/compositor/paint_recorder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698