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

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

Issue 1861383002: Add TaskManagerEndProcessEnabled policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update supported_on to 52 Created 4 years, 8 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
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/new_task_manager_view.h" 5 #include "chrome/browser/ui/views/new_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"
11 #include "chrome/browser/profiles/profile_manager.h" 11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/browser/profiles/profile_window.h" 12 #include "chrome/browser/profiles/profile_window.h"
13 #include "chrome/browser/task_management/task_manager_observer.h" 13 #include "chrome/browser/task_management/task_manager_observer.h"
14 #include "chrome/browser/task_manager/task_manager.h"
14 #include "chrome/browser/ui/browser_navigator_params.h" 15 #include "chrome/browser/ui/browser_navigator_params.h"
15 #include "chrome/browser/ui/task_manager/task_manager_columns.h" 16 #include "chrome/browser/ui/task_manager/task_manager_columns.h"
16 #include "chrome/browser/ui/user_manager.h" 17 #include "chrome/browser/ui/user_manager.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
19 #include "chrome/grit/chromium_strings.h" 20 #include "chrome/grit/chromium_strings.h"
20 #include "chrome/grit/generated_resources.h" 21 #include "chrome/grit/generated_resources.h"
21 #include "components/prefs/pref_service.h" 22 #include "components/prefs/pref_service.h"
22 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/models/table_model_observer.h" 24 #include "ui/base/models/table_model_observer.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 tab_table_->selection_model().selected_indices()); 249 tab_table_->selection_model().selected_indices());
249 bool selection_contains_browser_process = false; 250 bool selection_contains_browser_process = false;
250 for (const auto& selection : selections) { 251 for (const auto& selection : selections) {
251 if (table_model_->IsBrowserProcess(selection)) { 252 if (table_model_->IsBrowserProcess(selection)) {
252 selection_contains_browser_process = true; 253 selection_contains_browser_process = true;
253 break; 254 break;
254 } 255 }
255 } 256 }
256 257
257 kill_button_->SetEnabled(!selection_contains_browser_process && 258 kill_button_->SetEnabled(!selection_contains_browser_process &&
258 !selections.empty()); 259 !selections.empty() &&
260 TaskManager::IsEndProcessEnabled());
259 } 261 }
260 262
261 void NewTaskManagerView::OnDoubleClick() { 263 void NewTaskManagerView::OnDoubleClick() {
262 ActivateFocusedTab(); 264 ActivateFocusedTab();
263 } 265 }
264 266
265 void NewTaskManagerView::OnKeyDown(ui::KeyboardCode keycode) { 267 void NewTaskManagerView::OnKeyDown(ui::KeyboardCode keycode) {
266 if (keycode == ui::VKEY_RETURN) 268 if (keycode == ui::VKEY_RETURN)
267 ActivateFocusedTab(); 269 ActivateFocusedTab();
268 } 270 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 if (!g_browser_process->local_state()) 376 if (!g_browser_process->local_state())
375 return; 377 return;
376 378
377 const base::DictionaryValue* dictionary = 379 const base::DictionaryValue* dictionary =
378 g_browser_process->local_state()->GetDictionary(GetWindowName()); 380 g_browser_process->local_state()->GetDictionary(GetWindowName());
379 if (dictionary) 381 if (dictionary)
380 dictionary->GetBoolean("always_on_top", &is_always_on_top_); 382 dictionary->GetBoolean("always_on_top", &is_always_on_top_);
381 } 383 }
382 384
383 } // namespace task_management 385 } // namespace task_management
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698