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

Side by Side Diff: chrome/browser/ui/task_manager/task_manager_table_model.cc

Issue 1535803005: Fix task manager table scrollbar issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/task_manager/task_manager_table_model.h" 5 #include "chrome/browser/ui/task_manager/task_manager_table_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 void TaskManagerTableModel::OnTasksRefreshed( 577 void TaskManagerTableModel::OnTasksRefreshed(
578 const TaskIdList& task_ids) { 578 const TaskIdList& task_ids) {
579 tasks_ = task_ids; 579 tasks_ = task_ids;
580 OnRefresh(); 580 OnRefresh();
581 } 581 }
582 582
583 void TaskManagerTableModel::StartUpdating() { 583 void TaskManagerTableModel::StartUpdating() {
584 TaskManagerInterface::GetTaskManager()->AddObserver(this); 584 TaskManagerInterface::GetTaskManager()->AddObserver(this);
585 tasks_ = observed_task_manager()->GetTaskIdsList(); 585 tasks_ = observed_task_manager()->GetTaskIdsList();
586 OnRefresh(); 586 OnRefresh();
587
588 // In order for the scrollbar of the TableView to work properly on startup of
589 // the task manager, we must invoke TableModelObserver::OnModelChanged() which
590 // in turn will invoke TableView::NumRowsChanged(). This will adjust the
591 // vertical scrollbar correctly. crbug.com/570966.
592 if (table_model_observer_)
593 table_model_observer_->OnModelChanged();
587 } 594 }
588 595
589 void TaskManagerTableModel::StopUpdating() { 596 void TaskManagerTableModel::StopUpdating() {
590 observed_task_manager()->RemoveObserver(this); 597 observed_task_manager()->RemoveObserver(this);
591 } 598 }
592 599
593 void TaskManagerTableModel::ActivateTask(int row_index) { 600 void TaskManagerTableModel::ActivateTask(int row_index) {
594 observed_task_manager()->ActivateTask(tasks_[row_index]); 601 observed_task_manager()->ActivateTask(tasks_[row_index]);
595 } 602 }
596 603
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 bool TaskManagerTableModel::IsTaskFirstInGroup(int row_index) const { 809 bool TaskManagerTableModel::IsTaskFirstInGroup(int row_index) const {
803 if (row_index == 0) 810 if (row_index == 0)
804 return true; 811 return true;
805 812
806 return observed_task_manager()->GetProcessId(tasks_[row_index - 1]) != 813 return observed_task_manager()->GetProcessId(tasks_[row_index - 1]) !=
807 observed_task_manager()->GetProcessId(tasks_[row_index]); 814 observed_task_manager()->GetProcessId(tasks_[row_index]);
808 } 815 }
809 816
810 817
811 } // namespace task_management 818 } // namespace task_management
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