OLD | NEW |
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // If |sorted_column_id| is the default value, it means to clear the sort. | 145 // If |sorted_column_id| is the default value, it means to clear the sort. |
146 if (descriptor.sorted_column_id != TableSortDescriptor().sorted_column_id) { | 146 if (descriptor.sorted_column_id != TableSortDescriptor().sorted_column_id) { |
147 descriptor_list.emplace_back(descriptor.sorted_column_id, | 147 descriptor_list.emplace_back(descriptor.sorted_column_id, |
148 descriptor.is_ascending); | 148 descriptor.is_ascending); |
149 } | 149 } |
150 | 150 |
151 tab_table_->SetSortDescriptors(descriptor_list); | 151 tab_table_->SetSortDescriptors(descriptor_list); |
152 } | 152 } |
153 | 153 |
154 gfx::Size TaskManagerView::GetPreferredSize() const { | 154 gfx::Size TaskManagerView::GetPreferredSize() const { |
155 return gfx::Size(460, 270); | 155 gfx::Size table_size = tab_table_parent_->GetPreferredSize(); |
| 156 // The task name column expands to use excess space but also defaults to |
| 157 // to a very narrow width: just enough to fit "Task" in English, and not |
| 158 // enough to fit most actual task names such as "Tab: My email inbox". Add |
| 159 // some extra width here to make the task names more readable. |
| 160 table_size.set_width(table_size.width() + 180); |
| 161 table_size.set_height(270); |
| 162 gfx::Insets border = GetInsets(); |
| 163 table_size.Enlarge(border.width(), border.height()); |
| 164 return table_size; |
156 } | 165 } |
157 | 166 |
158 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 167 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
159 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); | 168 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); |
160 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); | 169 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); |
161 GetWidget()->Close(); | 170 GetWidget()->Close(); |
162 return true; | 171 return true; |
163 } | 172 } |
164 | 173 |
165 bool TaskManagerView::CanResize() const { | 174 bool TaskManagerView::CanResize() const { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (!g_browser_process->local_state()) | 371 if (!g_browser_process->local_state()) |
363 return; | 372 return; |
364 | 373 |
365 const base::DictionaryValue* dictionary = | 374 const base::DictionaryValue* dictionary = |
366 g_browser_process->local_state()->GetDictionary(GetWindowName()); | 375 g_browser_process->local_state()->GetDictionary(GetWindowName()); |
367 if (dictionary) | 376 if (dictionary) |
368 dictionary->GetBoolean("always_on_top", &is_always_on_top_); | 377 dictionary->GetBoolean("always_on_top", &is_always_on_top_); |
369 } | 378 } |
370 | 379 |
371 } // namespace task_manager | 380 } // namespace task_manager |
OLD | NEW |