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

Side by Side Diff: chrome/browser/ui/cocoa/task_manager_mac.mm

Issue 2524213002: MacViews: Consolidate flags. Just use --secondary-ui-md to enable MacViews. (Closed)
Patch Set: rebase for r435075 Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cocoa/task_manager_mac.h" 5 #include "chrome/browser/ui/cocoa/task_manager_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/mac/bundle_locations.h" 12 #include "base/mac/bundle_locations.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/sys_string_conversions.h" 14 #include "base/strings/sys_string_conversions.h"
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/task_manager/task_manager_interface.h" 17 #include "chrome/browser/task_manager/task_manager_interface.h"
18 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
19 #include "chrome/browser/ui/browser_dialogs.h" 19 #include "chrome/browser/ui/browser_dialogs.h"
20 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" 20 #import "chrome/browser/ui/cocoa/window_size_autosaver.h"
21 #include "chrome/browser/ui/task_manager/task_manager_columns.h" 21 #include "chrome/browser/ui/task_manager/task_manager_columns.h"
22 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
23 #include "chrome/grit/generated_resources.h" 23 #include "chrome/grit/generated_resources.h"
24 #include "components/prefs/pref_service.h" 24 #include "components/prefs/pref_service.h"
25 #include "content/public/browser/notification_service.h" 25 #include "content/public/browser/notification_service.h"
26 #include "content/public/browser/notification_source.h" 26 #include "content/public/browser/notification_source.h"
27 #include "third_party/skia/include/core/SkBitmap.h" 27 #include "third_party/skia/include/core/SkBitmap.h"
28 #include "ui/base/l10n/l10n_util_mac.h" 28 #include "ui/base/l10n/l10n_util_mac.h"
29 #include "ui/base/material_design/material_design_controller.h"
29 #include "ui/gfx/image/image_skia.h" 30 #include "ui/gfx/image/image_skia.h"
30 #include "ui/gfx/image/image_skia_util_mac.h" 31 #include "ui/gfx/image/image_skia_util_mac.h"
31 32
32 namespace { 33 namespace {
33 34
34 NSString* ColumnIdentifier(int id) { 35 NSString* ColumnIdentifier(int id) {
35 return [NSString stringWithFormat:@"%d", id]; 36 return [NSString stringWithFormat:@"%d", id];
36 } 37 }
37 38
38 } // namespace 39 } // namespace
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 if (instance_) 633 if (instance_)
633 [instance_->window_controller_ close]; 634 [instance_->window_controller_ close];
634 } 635 }
635 636
636 } // namespace task_manager 637 } // namespace task_manager
637 638
638 namespace chrome { 639 namespace chrome {
639 640
640 // Declared in browser_dialogs.h. 641 // Declared in browser_dialogs.h.
641 task_manager::TaskManagerTableModel* ShowTaskManager(Browser* browser) { 642 task_manager::TaskManagerTableModel* ShowTaskManager(Browser* browser) {
642 if (chrome::ToolkitViewsDialogsEnabled()) 643 if (ui::MaterialDesignController::IsSecondaryUiMaterial())
643 return chrome::ShowTaskManagerViews(browser); 644 return chrome::ShowTaskManagerViews(browser);
644 645
645 return task_manager::TaskManagerMac::Show(); 646 return task_manager::TaskManagerMac::Show();
646 } 647 }
647 648
648 void HideTaskManager() { 649 void HideTaskManager() {
649 if (chrome::ToolkitViewsDialogsEnabled()) { 650 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
650 chrome::HideTaskManagerViews(); 651 chrome::HideTaskManagerViews();
651 return; 652 return;
652 } 653 }
653 654
654 task_manager::TaskManagerMac::Hide(); 655 task_manager::TaskManagerMac::Hide();
655 } 656 }
656 657
657 } // namespace chrome 658 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698