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

Side by Side Diff: ui/views/examples/table_example.cc

Issue 361643002: setConfig is deprecated, use setInfo or allocPixels instead (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't call allocPixels+rowbytes yet (skia bug) Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/table/test_table_model.cc ('k') | ui/wm/core/image_grid_unittest.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/examples/table_example.h" 5 #include "ui/views/examples/table_example.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 std::vector<ui::TableColumn> columns; 64 std::vector<ui::TableColumn> columns;
65 columns.push_back(TestTableColumn(0, "Fruit")); 65 columns.push_back(TestTableColumn(0, "Fruit"));
66 columns[0].percent = 1; 66 columns[0].percent = 1;
67 columns.push_back(TestTableColumn(1, "Color")); 67 columns.push_back(TestTableColumn(1, "Color"));
68 columns.push_back(TestTableColumn(2, "Origin")); 68 columns.push_back(TestTableColumn(2, "Origin"));
69 columns.push_back(TestTableColumn(3, "Price")); 69 columns.push_back(TestTableColumn(3, "Price"));
70 columns.back().alignment = ui::TableColumn::RIGHT; 70 columns.back().alignment = ui::TableColumn::RIGHT;
71 table_ = new TableView(this, columns, ICON_AND_TEXT, true); 71 table_ = new TableView(this, columns, ICON_AND_TEXT, true);
72 table_->SetGrouper(this); 72 table_->SetGrouper(this);
73 table_->SetObserver(this); 73 table_->SetObserver(this);
74 icon1_.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 74 icon1_.allocN32Pixels(16, 16);
75 icon1_.allocPixels();
76 SkCanvas canvas1(icon1_); 75 SkCanvas canvas1(icon1_);
77 canvas1.drawColor(SK_ColorRED); 76 canvas1.drawColor(SK_ColorRED);
78 77
79 icon2_.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 78 icon2_.allocN32Pixels(16, 16);
80 icon2_.allocPixels();
81 SkCanvas canvas2(icon2_); 79 SkCanvas canvas2(icon2_);
82 canvas2.drawColor(SK_ColorBLUE); 80 canvas2.drawColor(SK_ColorBLUE);
83 81
84 ColumnSet* column_set = layout->AddColumnSet(0); 82 ColumnSet* column_set = layout->AddColumnSet(0);
85 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, 83 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
86 GridLayout::USE_PREF, 0, 0); 84 GridLayout::USE_PREF, 0, 0);
87 layout->StartRow(1 /* expand */, 0); 85 layout->StartRow(1 /* expand */, 0);
88 layout->AddView(table_->CreateParentIfNecessary()); 86 layout->AddView(table_->CreateParentIfNecessary());
89 87
90 column_set = layout->AddColumnSet(1); 88 column_set = layout->AddColumnSet(1);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 show = column3_visible_checkbox_->checked(); 171 show = column3_visible_checkbox_->checked();
174 } else if (sender == column4_visible_checkbox_) { 172 } else if (sender == column4_visible_checkbox_) {
175 index = 3; 173 index = 3;
176 show = column4_visible_checkbox_->checked(); 174 show = column4_visible_checkbox_->checked();
177 } 175 }
178 table_->SetColumnVisibility(index, show); 176 table_->SetColumnVisibility(index, show);
179 } 177 }
180 178
181 } // namespace examples 179 } // namespace examples
182 } // namespace views 180 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/table/test_table_model.cc ('k') | ui/wm/core/image_grid_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698