OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_VIEW_H_ | 5 #ifndef VIEWS_VIEW_H_ |
6 #define VIEWS_VIEW_H_ | 6 #define VIEWS_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace gfx { | 29 namespace gfx { |
30 class Canvas; | 30 class Canvas; |
31 class Insets; | 31 class Insets; |
32 class Path; | 32 class Path; |
33 } | 33 } |
34 | 34 |
35 namespace ui { | 35 namespace ui { |
36 struct AccessibleViewState; | 36 struct AccessibleViewState; |
37 class Compositor; | 37 class Compositor; |
38 class Layer; | 38 class Layer; |
| 39 class LayerAnimationSequence; |
39 class Texture; | 40 class Texture; |
40 class ThemeProvider; | 41 class ThemeProvider; |
41 class Transform; | 42 class Transform; |
42 enum TouchStatus; | 43 enum TouchStatus; |
43 } | 44 } |
44 | 45 |
45 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
46 class NativeViewAccessibilityWin; | 47 class NativeViewAccessibilityWin; |
47 #endif | 48 #endif |
48 | 49 |
49 namespace views { | 50 namespace views { |
50 | 51 |
51 class Background; | 52 class Background; |
52 class Border; | 53 class Border; |
53 class ContextMenuController; | 54 class ContextMenuController; |
54 class DragController; | 55 class DragController; |
55 class FocusManager; | 56 class FocusManager; |
56 class FocusTraversable; | 57 class FocusTraversable; |
57 class InputMethod; | 58 class InputMethod; |
58 class LayerPropertySetter; | |
59 class LayoutManager; | 59 class LayoutManager; |
60 class ScrollView; | 60 class ScrollView; |
61 class TextInputClient; | 61 class TextInputClient; |
62 class Widget; | 62 class Widget; |
63 | 63 |
64 namespace internal { | 64 namespace internal { |
65 class NativeWidgetView; | 65 class NativeWidgetView; |
66 class RootView; | 66 class RootView; |
67 } | 67 } |
68 | 68 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 void SetTransform(const ui::Transform& transform); | 279 void SetTransform(const ui::Transform& transform); |
280 | 280 |
281 // Sets whether this view paints to a layer. A view paints to a layer if | 281 // Sets whether this view paints to a layer. A view paints to a layer if |
282 // either of the following are true: | 282 // either of the following are true: |
283 // . the view has a non-identity transform. | 283 // . the view has a non-identity transform. |
284 // . SetPaintToLayer(true) has been invoked. | 284 // . SetPaintToLayer(true) has been invoked. |
285 // View creates the Layer only when it exists in a Widget with a non-NULL | 285 // View creates the Layer only when it exists in a Widget with a non-NULL |
286 // Compositor. | 286 // Compositor. |
287 void SetPaintToLayer(bool paint_to_layer); | 287 void SetPaintToLayer(bool paint_to_layer); |
288 | 288 |
289 // Sets the LayerPropertySetter for this view. A value of NULL resets the | |
290 // LayerPropertySetter to the default (immediate). Can only be called on a | |
291 // View that has a layer(). | |
292 void SetLayerPropertySetter(LayerPropertySetter* setter); | |
293 | |
294 const ui::Layer* layer() const { return layer_.get(); } | 289 const ui::Layer* layer() const { return layer_.get(); } |
295 ui::Layer* layer() { return layer_.get(); } | 290 ui::Layer* layer() { return layer_.get(); } |
296 | 291 |
297 // RTL positioning ----------------------------------------------------------- | 292 // RTL positioning ----------------------------------------------------------- |
298 | 293 |
299 // Methods for accessing the bounds and position of the view, relative to its | 294 // Methods for accessing the bounds and position of the view, relative to its |
300 // parent. The position returned is mirrored if the parent view is using a RTL | 295 // parent. The position returned is mirrored if the parent view is using a RTL |
301 // layout. | 296 // layout. |
302 // | 297 // |
303 // NOTE: in the vast majority of the cases, the mirroring implementation is | 298 // NOTE: in the vast majority of the cases, the mirroring implementation is |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 // the right layer. | 978 // the right layer. |
984 virtual void MoveLayerToParent(ui::Layer* parent_layer, | 979 virtual void MoveLayerToParent(ui::Layer* parent_layer, |
985 const gfx::Point& point); | 980 const gfx::Point& point); |
986 | 981 |
987 // Called to update the bounds of any child layers within this View's | 982 // Called to update the bounds of any child layers within this View's |
988 // hierarchy when something happens to the hierarchy. | 983 // hierarchy when something happens to the hierarchy. |
989 virtual void UpdateChildLayerBounds(const gfx::Point& offset); | 984 virtual void UpdateChildLayerBounds(const gfx::Point& offset); |
990 | 985 |
991 // Overridden from ui::LayerDelegate: | 986 // Overridden from ui::LayerDelegate: |
992 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; | 987 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; |
993 virtual void OnLayerAnimationEnded(const ui::Animation* animation) OVERRIDE; | 988 virtual void OnLayerAnimationEnded( |
| 989 const ui::LayerAnimationSequence* animation) OVERRIDE; |
994 | 990 |
995 // Finds the layer that this view paints to (it may belong to an ancestor | 991 // Finds the layer that this view paints to (it may belong to an ancestor |
996 // view), then reorders the immediate children of that layer to match the | 992 // view), then reorders the immediate children of that layer to match the |
997 // order of the view tree. | 993 // order of the view tree. |
998 virtual void ReorderLayers(); | 994 virtual void ReorderLayers(); |
999 | 995 |
1000 // This reorders the immediate children of |*parent_layer| to match the | 996 // This reorders the immediate children of |*parent_layer| to match the |
1001 // order of the view tree. | 997 // order of the view tree. |
1002 virtual void ReorderChildLayers(ui::Layer* parent_layer); | 998 virtual void ReorderChildLayers(ui::Layer* parent_layer); |
1003 | 999 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 | 1389 |
1394 // Indicates whether or not the gfx::Canvas object passed to View::Paint() | 1390 // Indicates whether or not the gfx::Canvas object passed to View::Paint() |
1395 // is going to be flipped horizontally (using the appropriate transform) on | 1391 // is going to be flipped horizontally (using the appropriate transform) on |
1396 // right-to-left locales for this View. | 1392 // right-to-left locales for this View. |
1397 bool flip_canvas_on_paint_for_rtl_ui_; | 1393 bool flip_canvas_on_paint_for_rtl_ui_; |
1398 | 1394 |
1399 // Accelerated painting ------------------------------------------------------ | 1395 // Accelerated painting ------------------------------------------------------ |
1400 | 1396 |
1401 bool paint_to_layer_; | 1397 bool paint_to_layer_; |
1402 scoped_ptr<ui::Layer> layer_; | 1398 scoped_ptr<ui::Layer> layer_; |
1403 scoped_ptr<LayerPropertySetter> layer_property_setter_; | |
1404 | 1399 |
1405 // Accelerators -------------------------------------------------------------- | 1400 // Accelerators -------------------------------------------------------------- |
1406 | 1401 |
1407 // true if when we were added to hierarchy we were without focus manager | 1402 // true if when we were added to hierarchy we were without focus manager |
1408 // attempt addition when ancestor chain changed. | 1403 // attempt addition when ancestor chain changed. |
1409 bool accelerator_registration_delayed_; | 1404 bool accelerator_registration_delayed_; |
1410 | 1405 |
1411 // Focus manager accelerators registered on. | 1406 // Focus manager accelerators registered on. |
1412 FocusManager* accelerator_focus_manager_; | 1407 FocusManager* accelerator_focus_manager_; |
1413 | 1408 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 #if defined(OS_WIN) | 1442 #if defined(OS_WIN) |
1448 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1443 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
1449 #endif | 1444 #endif |
1450 | 1445 |
1451 DISALLOW_COPY_AND_ASSIGN(View); | 1446 DISALLOW_COPY_AND_ASSIGN(View); |
1452 }; | 1447 }; |
1453 | 1448 |
1454 } // namespace views | 1449 } // namespace views |
1455 | 1450 |
1456 #endif // VIEWS_VIEW_H_ | 1451 #endif // VIEWS_VIEW_H_ |
OLD | NEW |