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

Side by Side Diff: ui/views/controls/table/table_view.cc

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased. 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 #include "ui/views/controls/table/table_view.h" 5 #include "ui/views/controls/table/table_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 row_height_(font_list_.GetHeight() + kTextVerticalPadding * 2), 138 row_height_(font_list_.GetHeight() + kTextVerticalPadding * 2),
139 last_parent_width_(0), 139 last_parent_width_(0),
140 layout_width_(0), 140 layout_width_(0),
141 grouper_(NULL), 141 grouper_(NULL),
142 in_set_visible_column_width_(false) { 142 in_set_visible_column_width_(false) {
143 for (size_t i = 0; i < columns.size(); ++i) { 143 for (size_t i = 0; i < columns.size(); ++i) {
144 VisibleColumn visible_column; 144 VisibleColumn visible_column;
145 visible_column.column = columns[i]; 145 visible_column.column = columns[i];
146 visible_columns_.push_back(visible_column); 146 visible_columns_.push_back(visible_column);
147 } 147 }
148 // On Mac, except textfields and lists, no control should be focusable by
149 // default. In Cocoa, lists are generally represented using NSTableView. Hence
150 // use ALWAYS focus behavior for TableView.
tapted 2016/04/20 06:05:58 This comment feels out of place. I think it's enou
karandeepb 2016/05/03 02:54:12 Done.
148 SetFocusBehavior(FocusBehavior::ALWAYS); 151 SetFocusBehavior(FocusBehavior::ALWAYS);
149 SetModel(model); 152 SetModel(model);
150 } 153 }
151 154
152 TableView::~TableView() { 155 TableView::~TableView() {
153 if (model_) 156 if (model_)
154 model_->SetObserver(NULL); 157 model_->SetObserver(NULL);
155 } 158 }
156 159
157 // TODO: this doesn't support arbitrarily changing the model, rename this to 160 // TODO: this doesn't support arbitrarily changing the model, rename this to
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 if (tooltip) 951 if (tooltip)
949 *tooltip = text; 952 *tooltip = text;
950 if (tooltip_origin) { 953 if (tooltip_origin) {
951 tooltip_origin->SetPoint(cell_bounds.x(), 954 tooltip_origin->SetPoint(cell_bounds.x(),
952 cell_bounds.y() + kTextVerticalPadding); 955 cell_bounds.y() + kTextVerticalPadding);
953 } 956 }
954 return true; 957 return true;
955 } 958 }
956 959
957 } // namespace views 960 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698