OLD | NEW |
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 <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/auto_reset.h" | 13 #include "base/auto_reset.h" |
14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "cc/paint/paint_flags.h" |
17 #include "ui/accessibility/ax_node_data.h" | 18 #include "ui/accessibility/ax_node_data.h" |
18 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
19 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
20 #include "ui/gfx/geometry/rect_conversions.h" | 21 #include "ui/gfx/geometry/rect_conversions.h" |
21 #include "ui/gfx/image/image_skia.h" | 22 #include "ui/gfx/image/image_skia.h" |
22 #include "ui/gfx/skia_util.h" | 23 #include "ui/gfx/skia_util.h" |
23 #include "ui/gfx/text_utils.h" | 24 #include "ui/gfx/text_utils.h" |
24 #include "ui/native_theme/native_theme.h" | 25 #include "ui/native_theme/native_theme.h" |
25 #include "ui/views/controls/scroll_view.h" | 26 #include "ui/views/controls/scroll_view.h" |
26 #include "ui/views/controls/table/table_grouper.h" | 27 #include "ui/views/controls/table/table_grouper.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 visible_columns_[j].column.alignment)); | 593 visible_columns_[j].column.alignment)); |
593 } | 594 } |
594 } | 595 } |
595 } | 596 } |
596 | 597 |
597 if (!grouper_ || region.min_column > 0) | 598 if (!grouper_ || region.min_column > 0) |
598 return; | 599 return; |
599 | 600 |
600 const SkColor grouping_color = GetNativeTheme()->GetSystemColor( | 601 const SkColor grouping_color = GetNativeTheme()->GetSystemColor( |
601 ui::NativeTheme::kColorId_TableGroupingIndicatorColor); | 602 ui::NativeTheme::kColorId_TableGroupingIndicatorColor); |
602 SkPaint grouping_paint; | 603 cc::PaintFlags grouping_paint; |
603 grouping_paint.setColor(grouping_color); | 604 grouping_paint.setColor(grouping_color); |
604 grouping_paint.setStyle(SkPaint::kFill_Style); | 605 grouping_paint.setStyle(cc::PaintFlags::kFill_Style); |
605 grouping_paint.setAntiAlias(true); | 606 grouping_paint.setAntiAlias(true); |
606 const int group_indicator_x = GetMirroredXInView(GetCellBounds(0, 0).x() + | 607 const int group_indicator_x = GetMirroredXInView(GetCellBounds(0, 0).x() + |
607 kTextHorizontalPadding + kGroupingIndicatorSize / 2); | 608 kTextHorizontalPadding + kGroupingIndicatorSize / 2); |
608 for (int i = region.min_row; i < region.max_row; ) { | 609 for (int i = region.min_row; i < region.max_row; ) { |
609 const int model_index = ViewToModel(i); | 610 const int model_index = ViewToModel(i); |
610 GroupRange range; | 611 GroupRange range; |
611 grouper_->GetGroupRange(model_index, &range); | 612 grouper_->GetGroupRange(model_index, &range); |
612 DCHECK_GT(range.length, 0); | 613 DCHECK_GT(range.length, 0); |
613 // The order of rows in a group is consistent regardless of sort, so it's ok | 614 // The order of rows in a group is consistent regardless of sort, so it's ok |
614 // to do this calculation. | 615 // to do this calculation. |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 if (tooltip) | 955 if (tooltip) |
955 *tooltip = text; | 956 *tooltip = text; |
956 if (tooltip_origin) { | 957 if (tooltip_origin) { |
957 tooltip_origin->SetPoint(cell_bounds.x(), | 958 tooltip_origin->SetPoint(cell_bounds.x(), |
958 cell_bounds.y() + kTextVerticalPadding); | 959 cell_bounds.y() + kTextVerticalPadding); |
959 } | 960 } |
960 return true; | 961 return true; |
961 } | 962 } |
962 | 963 |
963 } // namespace views | 964 } // namespace views |
OLD | NEW |