summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-15 18:09:52 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-15 18:09:52 +0000
commitc43207ea2d894f09a4079d4d97ad8591e8267553 (patch)
tree727703d181dbcdb75c7102e0e34b0bbe93c7d883 /views
parenta75965d3b1a1ed03ac54aac886d7b44726d7d164 (diff)
downloadchromium_src-c43207ea2d894f09a4079d4d97ad8591e8267553.zip
chromium_src-c43207ea2d894f09a4079d4d97ad8591e8267553.tar.gz
chromium_src-c43207ea2d894f09a4079d4d97ad8591e8267553.tar.bz2
Implement new task manager mocks on windows.
Added API to differentiate between background resources and normal foreground tabs, and added support for grouping processes containing background resources in a separate section of task manager. BUG=63140 TEST=bring up task manager on windows Review URL: http://codereview.chromium.org/4987001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/table/group_table_view.cc7
-rw-r--r--views/controls/table/group_table_view.h6
-rw-r--r--views/controls/table/table_view.cc6
3 files changed, 16 insertions, 3 deletions
diff --git a/views/controls/table/group_table_view.cc b/views/controls/table/group_table_view.cc
index efef1a5..4d34c56 100644
--- a/views/controls/table/group_table_view.cc
+++ b/views/controls/table/group_table_view.cc
@@ -21,10 +21,12 @@ GroupTableView::GroupTableView(GroupTableModel* model,
TableTypes table_type,
bool single_selection,
bool resizable_columns,
- bool autosize_columns)
+ bool autosize_columns,
+ bool draw_group_separators)
: TableView(model, columns, table_type, false, resizable_columns,
autosize_columns),
model_(model),
+ draw_group_separators_(draw_group_separators),
ALLOW_THIS_IN_INITIALIZER_LIST(sync_selection_factory_(this)) {
}
@@ -168,6 +170,9 @@ void GroupTableView::OnSelectedStateChanged() {
// Draws the line separator betweens the groups.
void GroupTableView::PostPaint(int model_row, int column, bool selected,
const gfx::Rect& bounds, HDC hdc) {
+ if (!draw_group_separators_)
+ return;
+
GroupRange group_range;
model_->GetGroupRangeForItem(model_row, &group_range);
diff --git a/views/controls/table/group_table_view.h b/views/controls/table/group_table_view.h
index d4853cb..adf0bac 100644
--- a/views/controls/table/group_table_view.h
+++ b/views/controls/table/group_table_view.h
@@ -37,7 +37,8 @@ class GroupTableView : public TableView {
GroupTableView(GroupTableModel* model,
const std::vector<TableColumn>& columns,
TableTypes table_type, bool single_selection,
- bool resizable_columns, bool autosize_columns);
+ bool resizable_columns, bool autosize_columns,
+ bool draw_group_separators);
virtual ~GroupTableView();
virtual std::string GetClassName() const;
@@ -70,6 +71,9 @@ class GroupTableView : public TableView {
GroupTableModel* model_;
+ // If true, draw separators between groups.
+ bool draw_group_separators_;
+
// A factory to make the selection consistent among groups.
ScopedRunnableMethodFactory<GroupTableView> sync_selection_factory_;
diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc
index 2eaab2b..cd7541a2 100644
--- a/views/controls/table/table_view.cc
+++ b/views/controls/table/table_view.cc
@@ -1406,11 +1406,15 @@ void TableView::UpdateListViewCache0(int start, int length, bool add) {
LVITEM item = {0};
if (add) {
const bool has_groups = model_->HasGroups();
- item.mask = has_groups ? (LVIF_GROUPID | LVIF_PARAM) : LVIF_PARAM;
for (int i = start; i < start + length; ++i) {
+ item.mask = has_groups ? (LVIF_GROUPID | LVIF_PARAM) : LVIF_PARAM;
item.iItem = i;
if (has_groups)
item.iGroupId = model_->GetGroupID(i);
+ if (model_->ShouldIndent(i)) {
+ item.mask |= LVIF_INDENT;
+ item.iIndent = 1;
+ }
item.lParam = i;
ListView_InsertItem(list_view_, &item);
}