Chromium Code Reviews| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 // If |sorted_column_id| is the default value, it means to clear the sort. | 140 // If |sorted_column_id| is the default value, it means to clear the sort. |
| 141 if (descriptor.sorted_column_id != TableSortDescriptor().sorted_column_id) { | 141 if (descriptor.sorted_column_id != TableSortDescriptor().sorted_column_id) { |
| 142 descriptor_list.emplace_back(descriptor.sorted_column_id, | 142 descriptor_list.emplace_back(descriptor.sorted_column_id, |
| 143 descriptor.is_ascending); | 143 descriptor.is_ascending); |
| 144 } | 144 } |
| 145 | 145 |
| 146 tab_table_->SetSortDescriptors(descriptor_list); | 146 tab_table_->SetSortDescriptors(descriptor_list); |
| 147 } | 147 } |
| 148 | 148 |
| 149 gfx::Size TaskManagerView::GetPreferredSize() const { | 149 gfx::Size TaskManagerView::GetPreferredSize() const { |
| 150 return gfx::Size(460, 270); | 150 gfx::Size contents_size(tab_table_->GetPreferredSize().width(), 270); |
|
sky
2016/09/15 02:52:13
I think you should be able to ask tab_table_parent
Evan Stade
2016/09/16 18:42:54
ok, done. I was wary of touching anything in Table
| |
| 151 gfx::Insets scroll_view_border = tab_table_parent_->GetInsets(); | |
| 152 contents_size.Enlarge(scroll_view_border.width(), | |
| 153 scroll_view_border.height()); | |
| 154 gfx::Insets border = GetInsets(); | |
| 155 contents_size.Enlarge(border.width(), border.height()); | |
| 156 return contents_size; | |
| 151 } | 157 } |
| 152 | 158 |
| 153 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 159 bool TaskManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 154 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); | 160 DCHECK_EQ(ui::VKEY_W, accelerator.key_code()); |
| 155 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); | 161 DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers()); |
| 156 GetWidget()->Close(); | 162 GetWidget()->Close(); |
| 157 return true; | 163 return true; |
| 158 } | 164 } |
| 159 | 165 |
| 160 bool TaskManagerView::CanResize() const { | 166 bool TaskManagerView::CanResize() const { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 if (!g_browser_process->local_state()) | 363 if (!g_browser_process->local_state()) |
| 358 return; | 364 return; |
| 359 | 365 |
| 360 const base::DictionaryValue* dictionary = | 366 const base::DictionaryValue* dictionary = |
| 361 g_browser_process->local_state()->GetDictionary(GetWindowName()); | 367 g_browser_process->local_state()->GetDictionary(GetWindowName()); |
| 362 if (dictionary) | 368 if (dictionary) |
| 363 dictionary->GetBoolean("always_on_top", &is_always_on_top_); | 369 dictionary->GetBoolean("always_on_top", &is_always_on_top_); |
| 364 } | 370 } |
| 365 | 371 |
| 366 } // namespace task_manager | 372 } // namespace task_manager |
| OLD | NEW |