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

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

Issue 2389803006: Revert of 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 gfx::Size table_size = tab_table_parent_->GetPreferredSize(); 155 return gfx::Size(460, 270);
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;
165 } 156 }
166 157
167 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { 158 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) {
168 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); 159 DCHECK_EQ(ui::VKEY_W, accelerator.key_code());
169 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); 160 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers());
170 GetWidget()->Close(); 161 GetWidget()->Close();
171 return true; 162 return true;
172 } 163 }
173 164
174 bool TaskManagerView::CanResize() const { 165 bool TaskManagerView::CanResize() const {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if (!g_browser_process->local_state()) 362 if (!g_browser_process->local_state())
372 return; 363 return;
373 364
374 const base::DictionaryValue* dictionary = 365 const base::DictionaryValue* dictionary =
375 g_browser_process->local_state()->GetDictionary(GetWindowName()); 366 g_browser_process->local_state()->GetDictionary(GetWindowName());
376 if (dictionary) 367 if (dictionary)
377 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 368 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
378 } 369 }
379 370
380 } // namespace task_manager 371 } // 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