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

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

Issue 2500623002: Add ViewObserver to View for view updates (Closed)
Patch Set: sadruls comments Created 4 years, 1 month 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class NativeTheme; 61 class NativeTheme;
62 class PaintContext; 62 class PaintContext;
63 class ThemeProvider; 63 class ThemeProvider;
64 } 64 }
65 65
66 namespace views { 66 namespace views {
67 67
68 class Background; 68 class Background;
69 class Border; 69 class Border;
70 class ContextMenuController; 70 class ContextMenuController;
71 class DevToolsObserver;
71 class DragController; 72 class DragController;
72 class FocusManager; 73 class FocusManager;
73 class FocusTraversable; 74 class FocusTraversable;
74 class LayoutManager; 75 class LayoutManager;
75 class NativeViewAccessibility; 76 class NativeViewAccessibility;
76 class ScrollView; 77 class ScrollView;
77 class Widget; 78 class Widget;
78 class WordLookupClient; 79 class WordLookupClient;
79 80
80 namespace internal { 81 namespace internal {
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 // to scroll. ScrollView interprets a return value of 0 (or negative) 994 // to scroll. ScrollView interprets a return value of 0 (or negative)
994 // to scroll by a default amount. 995 // to scroll by a default amount.
995 // 996 //
996 // See VariableRowHeightScrollHelper and FixedRowHeightScrollHelper for 997 // See VariableRowHeightScrollHelper and FixedRowHeightScrollHelper for
997 // implementations of common cases. 998 // implementations of common cases.
998 virtual int GetPageScrollIncrement(ScrollView* scroll_view, 999 virtual int GetPageScrollIncrement(ScrollView* scroll_view,
999 bool is_horizontal, bool is_positive); 1000 bool is_horizontal, bool is_positive);
1000 virtual int GetLineScrollIncrement(ScrollView* scroll_view, 1001 virtual int GetLineScrollIncrement(ScrollView* scroll_view,
1001 bool is_horizontal, bool is_positive); 1002 bool is_horizontal, bool is_positive);
1002 1003
1004 // DevTools Observer ---------------------------------------------------------
1005
1006 void set_devtools_observer(DevToolsObserver* devtools_observer) {
1007 devtools_observer_ = devtools_observer;
1008 };
1009
1003 protected: 1010 protected:
1004 // Used to track a drag. RootView passes this into 1011 // Used to track a drag. RootView passes this into
1005 // ProcessMousePressed/Dragged. 1012 // ProcessMousePressed/Dragged.
1006 struct DragInfo { 1013 struct DragInfo {
1007 // Sets possible_drag to false and start_x/y to 0. This is invoked by 1014 // Sets possible_drag to false and start_x/y to 0. This is invoked by
1008 // RootView prior to invoke ProcessMousePressed. 1015 // RootView prior to invoke ProcessMousePressed.
1009 void Reset(); 1016 void Reset();
1010 1017
1011 // Sets possible_drag to true and start_pt to the specified point. 1018 // Sets possible_drag to true and start_pt to the specified point.
1012 // This is invoked by the target view if it detects the press may generate 1019 // This is invoked by the target view if it detects the press may generate
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 // Input -------------------------------------------------------------------- 1575 // Input --------------------------------------------------------------------
1569 1576
1570 std::unique_ptr<ViewTargeter> targeter_; 1577 std::unique_ptr<ViewTargeter> targeter_;
1571 1578
1572 // Accessibility ------------------------------------------------------------- 1579 // Accessibility -------------------------------------------------------------
1573 1580
1574 // Belongs to this view, but it's reference-counted on some platforms 1581 // Belongs to this view, but it's reference-counted on some platforms
1575 // so we can't use a scoped_ptr. It's dereferenced in the destructor. 1582 // so we can't use a scoped_ptr. It's dereferenced in the destructor.
1576 NativeViewAccessibility* native_view_accessibility_; 1583 NativeViewAccessibility* native_view_accessibility_;
1577 1584
1585 // Observers -------------------------------------------------------------
1586
1587 DevToolsObserver* devtools_observer_;
1588
1578 DISALLOW_COPY_AND_ASSIGN(View); 1589 DISALLOW_COPY_AND_ASSIGN(View);
1579 }; 1590 };
1580 1591
1581 } // namespace views 1592 } // namespace views
1582 1593
1583 #endif // UI_VIEWS_VIEW_H_ 1594 #endif // UI_VIEWS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698