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

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

Issue 2344703002: Fix task manager's default sizing. (Closed)
Patch Set: . Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/views/task_manager_view.h ('k') | ui/views/controls/scroll_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 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/views/task_manager_view.h" 5 #include "chrome/browser/ui/views/task_manager_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // If |sorted_column_id| is the default value, it means to clear the sort. 146 // If |sorted_column_id| is the default value, it means to clear the sort.
147 if (descriptor.sorted_column_id != TableSortDescriptor().sorted_column_id) { 147 if (descriptor.sorted_column_id != TableSortDescriptor().sorted_column_id) {
148 descriptor_list.emplace_back(descriptor.sorted_column_id, 148 descriptor_list.emplace_back(descriptor.sorted_column_id,
149 descriptor.is_ascending); 149 descriptor.is_ascending);
150 } 150 }
151 151
152 tab_table_->SetSortDescriptors(descriptor_list); 152 tab_table_->SetSortDescriptors(descriptor_list);
153 } 153 }
154 154
155 gfx::Size TaskManagerView::GetPreferredSize() const { 155 gfx::Size TaskManagerView::GetPreferredSize() const {
156 return gfx::Size(460, 270); 156 gfx::Size table_size = tab_table_parent_->GetPreferredSize();
157 // The task name column expands to use excess space but also defaults to
sky 2016/09/23 16:22:25 'to to' -> 'to'
Evan Stade 2016/10/04 01:33:13 Done.
158 // to a very narrow width. Add some extra width here to make the task names
159 // more readable.
160 table_size.set_width(table_size.width() + 180);
Evan Stade 2016/09/22 22:42:47 I also added this because columns that have an exp
sky 2016/09/23 16:22:26 I recommend expanding your comment to include this
Evan Stade 2016/10/04 01:33:13 Tried to improve/elaborate comment.
161 table_size.set_height(270);
162 gfx::Insets border = GetInsets();
163 table_size.Enlarge(border.width(), border.height());
164 return table_size;
157 } 165 }
158 166
159 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { 167 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) {
160 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); 168 DCHECK_EQ(ui::VKEY_W, accelerator.key_code());
161 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); 169 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers());
162 GetWidget()->Close(); 170 GetWidget()->Close();
163 return true; 171 return true;
164 } 172 }
165 173
166 bool TaskManagerView::CanResize() const { 174 bool TaskManagerView::CanResize() const {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (!g_browser_process->local_state()) 371 if (!g_browser_process->local_state())
364 return; 372 return;
365 373
366 const base::DictionaryValue* dictionary = 374 const base::DictionaryValue* dictionary =
367 g_browser_process->local_state()->GetDictionary(GetWindowName()); 375 g_browser_process->local_state()->GetDictionary(GetWindowName());
368 if (dictionary) 376 if (dictionary)
369 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 377 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
370 } 378 }
371 379
372 } // namespace task_manager 380 } // namespace task_manager
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/task_manager_view.h ('k') | ui/views/controls/scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698