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

Side by Side Diff: ui/views/view.h

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Fix compile failures Created 3 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_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 void SetTransform(const gfx::Transform& transform); 333 void SetTransform(const gfx::Transform& transform);
334 334
335 // Sets whether this view paints to a layer. A view paints to a layer if 335 // Sets whether this view paints to a layer. A view paints to a layer if
336 // either of the following are true: 336 // either of the following are true:
337 // . the view has a non-identity transform. 337 // . the view has a non-identity transform.
338 // . SetPaintToLayer(ui::LayerType) has been invoked. 338 // . SetPaintToLayer(ui::LayerType) has been invoked.
339 // View creates the Layer only when it exists in a Widget with a non-NULL 339 // View creates the Layer only when it exists in a Widget with a non-NULL
340 // Compositor. 340 // Compositor.
341 void SetPaintToLayer(ui::LayerType layer_type = ui::LAYER_TEXTURED); 341 void SetPaintToLayer(ui::LayerType layer_type = ui::LAYER_TEXTURED);
342 342
343 // Destroys the layer associated with this view, and reparents any descendants 343 // Please refer to the comments above the DestroyLayerImpl() function for
344 // to the destroyed layer's parent. If the view does not currently have a 344 // details.
345 // layer, this has no effect.
346 void DestroyLayer(); 345 void DestroyLayer();
347 346
348 // Overridden from ui::LayerOwner: 347 // Overridden from ui::LayerOwner:
349 std::unique_ptr<ui::Layer> RecreateLayer() override; 348 std::unique_ptr<ui::Layer> RecreateLayer() override;
350 349
351 // RTL positioning ----------------------------------------------------------- 350 // RTL positioning -----------------------------------------------------------
352 351
353 // Methods for accessing the bounds and position of the view, relative to its 352 // Methods for accessing the bounds and position of the view, relative to its
354 // parent. The position returned is mirrored if the parent view is using a RTL 353 // parent. The position returned is mirrored if the parent view is using a RTL
355 // layout. 354 // layout.
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 virtual void ReorderLayers(); 1181 virtual void ReorderLayers();
1183 1182
1184 // This reorders the immediate children of |*parent_layer| to match the 1183 // This reorders the immediate children of |*parent_layer| to match the
1185 // order of the view tree. Child layers which are owned by a view are 1184 // order of the view tree. Child layers which are owned by a view are
1186 // reordered so that they are below any child layers not owned by a view. 1185 // reordered so that they are below any child layers not owned by a view.
1187 // Widget::ReorderNativeViews() should be called to reorder any child layers 1186 // Widget::ReorderNativeViews() should be called to reorder any child layers
1188 // with an associated view. Widget::ReorderNativeViews() may reorder layers 1187 // with an associated view. Widget::ReorderNativeViews() may reorder layers
1189 // below layers owned by a view. 1188 // below layers owned by a view.
1190 virtual void ReorderChildLayers(ui::Layer* parent_layer); 1189 virtual void ReorderChildLayers(ui::Layer* parent_layer);
1191 1190
1191 // Notifies parents about a layer being created or destroyed in a child. An
1192 // example where a subclass may override this method is when it wants to clip
1193 // the child by adding its own layer.
1194 virtual void OnChildLayerChanged(View* child);
1195
1196 enum class LayerChangeNotifyBehavior {
sky 2017/04/19 00:03:05 Move this and the other functions (except for OnCh
ananta 2017/04/19 00:53:17 Done.
1197 // Notify the parent chain about the layer change.
1198 NOTIFY,
1199 // Don't notify the parent chain about the layer change.
1200 DONT_NOTIFY
1201 };
1202
1203 // Destroys the layer associated with this view, and reparents any descendants
1204 // to the destroyed layer's parent. If the view does not currently have a
1205 // layer, this has no effect.
1206 // The |notify_parents| enum controls whether a notification about the layer
1207 // change is sent to the parents.
1208 void DestroyLayerImpl(LayerChangeNotifyBehavior notify_parents);
1209
1210 // Notifies parents about layering changes in the view. This includes layer
1211 // creation and destruction.
1212 void NotifyParentsOfLayerChange();
1213
1192 // Input --------------------------------------------------------------------- 1214 // Input ---------------------------------------------------------------------
1193 1215
1194 virtual DragInfo* GetDragInfo(); 1216 virtual DragInfo* GetDragInfo();
1195 1217
1196 // Focus --------------------------------------------------------------------- 1218 // Focus ---------------------------------------------------------------------
1197 1219
1198 // Returns last set focus behavior. 1220 // Returns last set focus behavior.
1199 FocusBehavior focus_behavior() const { return focus_behavior_; } 1221 FocusBehavior focus_behavior() const { return focus_behavior_; }
1200 1222
1201 // Override to be notified when focus has changed either to or from this View. 1223 // Override to be notified when focus has changed either to or from this View.
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 // Observers ------------------------------------------------------------- 1692 // Observers -------------------------------------------------------------
1671 1693
1672 base::ObserverList<ViewObserver> observers_; 1694 base::ObserverList<ViewObserver> observers_;
1673 1695
1674 DISALLOW_COPY_AND_ASSIGN(View); 1696 DISALLOW_COPY_AND_ASSIGN(View);
1675 }; 1697 };
1676 1698
1677 } // namespace views 1699 } // namespace views
1678 1700
1679 #endif // UI_VIEWS_VIEW_H_ 1701 #endif // UI_VIEWS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698