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

Side by Side Diff: chrome/browser/ui/views/task_manager_view.cc

Issue 6240001: Stop rebuilding the task manager list view after every new row added. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/table_model_observer.h" 8 #include "app/table_model_observer.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void TaskManagerTableModel::OnItemsChanged(int start, int length) { 175 void TaskManagerTableModel::OnItemsChanged(int start, int length) {
176 if (observer_) 176 if (observer_)
177 observer_->OnItemsChanged(start, length); 177 observer_->OnItemsChanged(start, length);
178 } 178 }
179 179
180 void TaskManagerTableModel::OnItemsAdded(int start, int length) { 180 void TaskManagerTableModel::OnItemsAdded(int start, int length) {
181 if (observer_) 181 if (observer_)
182 observer_->OnItemsAdded(start, length); 182 observer_->OnItemsAdded(start, length);
183 // There's a bug in the Windows ListView where inserting items with groups 183 // There's a bug in the Windows ListView where inserting items with groups
184 // enabled puts them in the wrong position, so we just rebuild the list view 184 // enabled puts them in the wrong position, so we will need to rebuild the
185 // in this case. 185 // list view in this case.
186 // (see: http://connect.microsoft.com/VisualStudio/feedback/details/115345/) 186 // (see: http://connect.microsoft.com/VisualStudio/feedback/details/115345/).
187 OnModelChanged(); 187 //
188 // Turns out, forcing a list view rebuild causes http://crbug.com/69391
189 // because items are added to the ListView one-at-a-time when initially
190 // displaying the TaskManager, resulting in many ListView rebuilds. So we are
191 // no longer forcing a rebuild for now because the current UI doesn't use
192 // groups - if we are going to add groups in the upcoming TaskManager UI
193 // revamp, we'll need to re-enable this call to OnModelChanged() and also add
194 // code to avoid doing multiple rebuilds on startup (maybe just generate a
195 // single OnModelChanged() call after the initial population).
196
197 // OnModelChanged();
188 } 198 }
189 199
190 void TaskManagerTableModel::OnItemsRemoved(int start, int length) { 200 void TaskManagerTableModel::OnItemsRemoved(int start, int length) {
191 if (observer_) 201 if (observer_)
192 observer_->OnItemsRemoved(start, length); 202 observer_->OnItemsRemoved(start, length);
193 203
194 // We may need to change the indentation of some items if the topmost item 204 // We may need to change the indentation of some items if the topmost item
195 // in the group was removed, so update the view. 205 // in the group was removed, so update the view.
196 OnModelChanged(); 206 OnModelChanged();
197 } 207 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 } // namespace 706 } // namespace
697 707
698 namespace browser { 708 namespace browser {
699 709
700 // Declared in browser_dialogs.h so others don't need to depend on our header. 710 // Declared in browser_dialogs.h so others don't need to depend on our header.
701 void ShowTaskManager() { 711 void ShowTaskManager() {
702 TaskManagerView::Show(); 712 TaskManagerView::Show();
703 } 713 }
704 714
705 } // namespace browser 715 } // namespace browser
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698