| 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 "skia/ext/cdl_paint.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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 visible_columns_[j].column.alignment)); | 597 visible_columns_[j].column.alignment)); |
| 597 } | 598 } |
| 598 } | 599 } |
| 599 } | 600 } |
| 600 | 601 |
| 601 if (!grouper_ || region.min_column > 0) | 602 if (!grouper_ || region.min_column > 0) |
| 602 return; | 603 return; |
| 603 | 604 |
| 604 const SkColor grouping_color = GetNativeTheme()->GetSystemColor( | 605 const SkColor grouping_color = GetNativeTheme()->GetSystemColor( |
| 605 ui::NativeTheme::kColorId_TableGroupingIndicatorColor); | 606 ui::NativeTheme::kColorId_TableGroupingIndicatorColor); |
| 606 SkPaint grouping_paint; | 607 CdlPaint grouping_paint; |
| 607 grouping_paint.setColor(grouping_color); | 608 grouping_paint.setColor(grouping_color); |
| 608 grouping_paint.setStyle(SkPaint::kFill_Style); | 609 grouping_paint.setStyle(CdlPaint::kFill_Style); |
| 609 grouping_paint.setAntiAlias(true); | 610 grouping_paint.setAntiAlias(true); |
| 610 const int group_indicator_x = GetMirroredXInView(GetCellBounds(0, 0).x() + | 611 const int group_indicator_x = GetMirroredXInView(GetCellBounds(0, 0).x() + |
| 611 kTextHorizontalPadding + kGroupingIndicatorSize / 2); | 612 kTextHorizontalPadding + kGroupingIndicatorSize / 2); |
| 612 for (int i = region.min_row; i < region.max_row; ) { | 613 for (int i = region.min_row; i < region.max_row; ) { |
| 613 const int model_index = ViewToModel(i); | 614 const int model_index = ViewToModel(i); |
| 614 GroupRange range; | 615 GroupRange range; |
| 615 grouper_->GetGroupRange(model_index, &range); | 616 grouper_->GetGroupRange(model_index, &range); |
| 616 DCHECK_GT(range.length, 0); | 617 DCHECK_GT(range.length, 0); |
| 617 // The order of rows in a group is consistent regardless of sort, so it's ok | 618 // The order of rows in a group is consistent regardless of sort, so it's ok |
| 618 // to do this calculation. | 619 // to do this calculation. |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 if (tooltip) | 959 if (tooltip) |
| 959 *tooltip = text; | 960 *tooltip = text; |
| 960 if (tooltip_origin) { | 961 if (tooltip_origin) { |
| 961 tooltip_origin->SetPoint(cell_bounds.x(), | 962 tooltip_origin->SetPoint(cell_bounds.x(), |
| 962 cell_bounds.y() + kTextVerticalPadding); | 963 cell_bounds.y() + kTextVerticalPadding); |
| 963 } | 964 } |
| 964 return true; | 965 return true; |
| 965 } | 966 } |
| 966 | 967 |
| 967 } // namespace views | 968 } // namespace views |
| OLD | NEW |