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

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

Issue 1915863004: Remove View::focusable() - Alternate approach. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Created 4 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 // with an associated view. Widget::ReorderNativeViews() may reorder layers 1137 // with an associated view. Widget::ReorderNativeViews() may reorder layers
1138 // below layers owned by a view. 1138 // below layers owned by a view.
1139 virtual void ReorderChildLayers(ui::Layer* parent_layer); 1139 virtual void ReorderChildLayers(ui::Layer* parent_layer);
1140 1140
1141 // Input --------------------------------------------------------------------- 1141 // Input ---------------------------------------------------------------------
1142 1142
1143 virtual DragInfo* GetDragInfo(); 1143 virtual DragInfo* GetDragInfo();
1144 1144
1145 // Focus --------------------------------------------------------------------- 1145 // Focus ---------------------------------------------------------------------
1146 1146
1147 // Returns true if ALWAYS is the last set focus behavior. Use IsFocusable() to
1148 // determine if a view can take focus right now.
1149 bool focusable() const { return focus_behavior_ == FocusBehavior::ALWAYS; }
1150
1151 // Override to be notified when focus has changed either to or from this View. 1147 // Override to be notified when focus has changed either to or from this View.
1152 virtual void OnFocus(); 1148 virtual void OnFocus();
1153 virtual void OnBlur(); 1149 virtual void OnBlur();
1154 1150
1155 // Handle view focus/blur events for this view. 1151 // Handle view focus/blur events for this view.
1156 void Focus(); 1152 void Focus();
1157 void Blur(); 1153 void Blur();
1158 1154
1159 // System events ------------------------------------------------------------- 1155 // System events -------------------------------------------------------------
1160 1156
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 // Belongs to this view, but it's reference-counted on some platforms 1564 // Belongs to this view, but it's reference-counted on some platforms
1569 // so we can't use a scoped_ptr. It's dereferenced in the destructor. 1565 // so we can't use a scoped_ptr. It's dereferenced in the destructor.
1570 NativeViewAccessibility* native_view_accessibility_; 1566 NativeViewAccessibility* native_view_accessibility_;
1571 1567
1572 DISALLOW_COPY_AND_ASSIGN(View); 1568 DISALLOW_COPY_AND_ASSIGN(View);
1573 }; 1569 };
1574 1570
1575 } // namespace views 1571 } // namespace views
1576 1572
1577 #endif // UI_VIEWS_VIEW_H_ 1573 #endif // UI_VIEWS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698