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

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

Issue 1870573003: Full Keyboard Access: Second Approach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « ui/views/controls/tabbed_pane/tabbed_pane.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
11 11
12 #include "base/auto_reset.h" 12 #include "base/auto_reset.h"
13 #include "base/i18n/rtl.h" 13 #include "base/i18n/rtl.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "ui/accessibility/ax_view_state.h" 16 #include "ui/accessibility/ax_view_state.h"
17 #include "ui/events/event.h" 17 #include "ui/events/event.h"
18 #include "ui/gfx/canvas.h" 18 #include "ui/gfx/canvas.h"
19 #include "ui/gfx/geometry/rect_conversions.h" 19 #include "ui/gfx/geometry/rect_conversions.h"
20 #include "ui/gfx/image/image_skia.h" 20 #include "ui/gfx/image/image_skia.h"
21 #include "ui/gfx/skia_util.h" 21 #include "ui/gfx/skia_util.h"
22 #include "ui/gfx/text_utils.h" 22 #include "ui/gfx/text_utils.h"
23 #include "ui/native_theme/native_theme.h" 23 #include "ui/native_theme/native_theme.h"
24 #include "ui/views/controls/scroll_view.h" 24 #include "ui/views/controls/scroll_view.h"
25 #include "ui/views/controls/table/table_grouper.h" 25 #include "ui/views/controls/table/table_grouper.h"
26 #include "ui/views/controls/table/table_header.h" 26 #include "ui/views/controls/table/table_header.h"
27 #include "ui/views/controls/table/table_utils.h" 27 #include "ui/views/controls/table/table_utils.h"
28 #include "ui/views/controls/table/table_view_observer.h" 28 #include "ui/views/controls/table/table_view_observer.h"
29 #include "ui/views/controls/table/table_view_row_background_painter.h" 29 #include "ui/views/controls/table/table_view_row_background_painter.h"
30 #include "ui/views/style/platform_style.h"
30 31
31 // Padding around the text (on each side). 32 // Padding around the text (on each side).
32 static const int kTextVerticalPadding = 3; 33 static const int kTextVerticalPadding = 3;
33 static const int kTextHorizontalPadding = 6; 34 static const int kTextHorizontalPadding = 6;
34 35
35 // Size of images. 36 // Size of images.
36 static const int kImageSize = 16; 37 static const int kImageSize = 16;
37 38
38 static const int kGroupingIndicatorSize = 6; 39 static const int kGroupingIndicatorSize = 6;
39 40
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 row_height_(font_list_.GetHeight() + kTextVerticalPadding * 2), 139 row_height_(font_list_.GetHeight() + kTextVerticalPadding * 2),
139 last_parent_width_(0), 140 last_parent_width_(0),
140 layout_width_(0), 141 layout_width_(0),
141 grouper_(NULL), 142 grouper_(NULL),
142 in_set_visible_column_width_(false) { 143 in_set_visible_column_width_(false) {
143 for (size_t i = 0; i < columns.size(); ++i) { 144 for (size_t i = 0; i < columns.size(); ++i) {
144 VisibleColumn visible_column; 145 VisibleColumn visible_column;
145 visible_column.column = columns[i]; 146 visible_column.column = columns[i];
146 visible_columns_.push_back(visible_column); 147 visible_columns_.push_back(visible_column);
147 } 148 }
148 SetFocusable(true); 149 PlatformStyle::ConfigureFocus(PlatformStyle::CONTROL::TABLE_VIEW, this);
149 SetModel(model); 150 SetModel(model);
150 } 151 }
151 152
152 TableView::~TableView() { 153 TableView::~TableView() {
153 if (model_) 154 if (model_)
154 model_->SetObserver(NULL); 155 model_->SetObserver(NULL);
155 } 156 }
156 157
157 // TODO: this doesn't support arbitrarily changing the model, rename this to 158 // TODO: this doesn't support arbitrarily changing the model, rename this to
158 // ClearModel() or something. 159 // ClearModel() or something.
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 if (tooltip) 949 if (tooltip)
949 *tooltip = text; 950 *tooltip = text;
950 if (tooltip_origin) { 951 if (tooltip_origin) {
951 tooltip_origin->SetPoint(cell_bounds.x(), 952 tooltip_origin->SetPoint(cell_bounds.x(),
952 cell_bounds.y() + kTextVerticalPadding); 953 cell_bounds.y() + kTextVerticalPadding);
953 } 954 }
954 return true; 955 return true;
955 } 956 }
956 957
957 } // namespace views 958 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/tabbed_pane/tabbed_pane.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698