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

Unified Diff: ui/views/controls/scroll_view.h

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Address review comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/scroll_view.h
diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h
index af9111a05cae1a2dd25daba64afe629560c7751e..85c46159b4ce0fd41e9cd03094041ce70b5fb243 100644
--- a/ui/views/controls/scroll_view.h
+++ b/ui/views/controls/scroll_view.h
@@ -17,6 +17,8 @@ class ScrollOffset;
}
namespace views {
+class ViewObserverTest;
+
namespace test {
class ScrollViewTestApi;
}
@@ -105,6 +107,9 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
void OnGestureEvent(ui::GestureEvent* event) override;
const char* GetClassName() const override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
+ void ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) override;
+ void OnChildLayerChanged(View* child) override;
// ScrollBarController overrides:
void ScrollToPosition(ScrollBar* source, int position) override;
@@ -118,6 +123,7 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
private:
friend class test::ScrollViewTestApi;
+ FRIEND_TEST_ALL_PREFIXES(ViewObserverTest, ScrollViewChildAddLayerTest);
class Viewport;
@@ -162,6 +168,11 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
void AddBorder();
void UpdateBorder();
+ // Enables view port layering if |child| or any of its descendants has a
+ // layer. Returns true if yes. We short circuit the recursion if we enabled
+ // layering.
+ bool EnableLayeringRecursivelyForChild(View* child);
+
// The current contents and its viewport. |contents_| is contained in
// |contents_viewport_|.
View* contents_;
@@ -204,6 +215,12 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController {
// Focus ring, if one is installed.
View* focus_ring_ = nullptr;
+ // Set to true if we enabled layering for the viewport.
+ bool viewport_layer_enabled_ = false;
+
+ // Set to true if the scroll with layers feature is enabled.
+ const bool scroll_with_layers_enabled_ = false;
sky 2017/04/19 15:03:56 Remove the = false here as this is now assigned in
ananta 2017/04/19 19:04:19 Done.
+
DISALLOW_COPY_AND_ASSIGN(ScrollView);
};
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698