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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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/table/table_view.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_header.h" 5 #include "ui/views/controls/table/table_header.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "skia/ext/cdl_paint.h"
9 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
10 #include "third_party/skia/include/core/SkPaint.h" 11 #include "third_party/skia/include/core/SkPaint.h"
11 #include "third_party/skia/include/core/SkPath.h" 12 #include "third_party/skia/include/core/SkPath.h"
12 #include "ui/base/cursor/cursor.h" 13 #include "ui/base/cursor/cursor.h"
13 #include "ui/gfx/canvas.h" 14 #include "ui/gfx/canvas.h"
14 #include "ui/gfx/text_utils.h" 15 #include "ui/gfx/text_utils.h"
15 #include "ui/native_theme/native_theme.h" 16 #include "ui/native_theme/native_theme.h"
16 #include "ui/views/background.h" 17 #include "ui/views/background.h"
17 #include "ui/views/controls/table/table_utils.h" 18 #include "ui/views/controls/table/table_utils.h"
18 #include "ui/views/controls/table/table_view.h" 19 #include "ui/views/controls/table/table_view.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 width -= kSortIndicatorWidth; 103 width -= kSortIndicatorWidth;
103 } 104 }
104 105
105 canvas->DrawStringRectWithFlags( 106 canvas->DrawStringRectWithFlags(
106 columns[i].column.title, font_list_, kTextColor, 107 columns[i].column.title, font_list_, kTextColor,
107 gfx::Rect(GetMirroredXWithWidthInView(x, width), kVerticalPadding, 108 gfx::Rect(GetMirroredXWithWidthInView(x, width), kVerticalPadding,
108 width, height() - kVerticalPadding * 2), 109 width, height() - kVerticalPadding * 2),
109 TableColumnAlignmentToCanvasAlignment(columns[i].column.alignment)); 110 TableColumnAlignmentToCanvasAlignment(columns[i].column.alignment));
110 111
111 if (paint_sort_indicator) { 112 if (paint_sort_indicator) {
112 SkPaint paint; 113 CdlPaint paint;
113 paint.setColor(kTextColor); 114 paint.setColor(kTextColor);
114 paint.setStyle(SkPaint::kFill_Style); 115 paint.setStyle(CdlPaint::kFill_Style);
115 paint.setAntiAlias(true); 116 paint.setAntiAlias(true);
116 117
117 int indicator_x = 0; 118 int indicator_x = 0;
118 ui::TableColumn::Alignment alignment = columns[i].column.alignment; 119 ui::TableColumn::Alignment alignment = columns[i].column.alignment;
119 if (base::i18n::IsRTL()) { 120 if (base::i18n::IsRTL()) {
120 if (alignment == ui::TableColumn::LEFT) 121 if (alignment == ui::TableColumn::LEFT)
121 alignment = ui::TableColumn::RIGHT; 122 alignment = ui::TableColumn::RIGHT;
122 else if (alignment == ui::TableColumn::RIGHT) 123 else if (alignment == ui::TableColumn::RIGHT)
123 alignment = ui::TableColumn::LEFT; 124 alignment = ui::TableColumn::LEFT;
124 } 125 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 if (index > 0 && x >= column.x - kResizePadding && 280 if (index > 0 && x >= column.x - kResizePadding &&
280 x <= column.x + kResizePadding) { 281 x <= column.x + kResizePadding) {
281 return index - 1; 282 return index - 1;
282 } 283 }
283 const int max_x = column.x + column.width; 284 const int max_x = column.x + column.width;
284 return (x >= max_x - kResizePadding && x <= max_x + kResizePadding) ? 285 return (x >= max_x - kResizePadding && x <= max_x + kResizePadding) ?
285 index : -1; 286 index : -1;
286 } 287 }
287 288
288 } // namespace views 289 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/tabbed_pane/tabbed_pane.cc ('k') | ui/views/controls/table/table_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698