OLD | NEW |
---|---|
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/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
11 #include "base/prefs/pref_service.h" | |
11 #include "base/process/process_metrics.h" | 12 #include "base/process/process_metrics.h" |
12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/profiles/profile_window.h" | |
19 #include "chrome/browser/task_manager/background_information.h" | 21 #include "chrome/browser/task_manager/background_information.h" |
20 #include "chrome/browser/task_manager/browser_process_resource_provider.h" | 22 #include "chrome/browser/task_manager/browser_process_resource_provider.h" |
21 #include "chrome/browser/task_manager/child_process_resource_provider.h" | 23 #include "chrome/browser/task_manager/child_process_resource_provider.h" |
22 #include "chrome/browser/task_manager/extension_information.h" | 24 #include "chrome/browser/task_manager/extension_information.h" |
23 #include "chrome/browser/task_manager/guest_information.h" | 25 #include "chrome/browser/task_manager/guest_information.h" |
24 #include "chrome/browser/task_manager/panel_information.h" | 26 #include "chrome/browser/task_manager/panel_information.h" |
25 #include "chrome/browser/task_manager/printing_information.h" | 27 #include "chrome/browser/task_manager/printing_information.h" |
26 #include "chrome/browser/task_manager/resource_provider.h" | 28 #include "chrome/browser/task_manager/resource_provider.h" |
27 #include "chrome/browser/task_manager/tab_contents_information.h" | 29 #include "chrome/browser/task_manager/tab_contents_information.h" |
28 #include "chrome/browser/task_manager/web_contents_resource_provider.h" | 30 #include "chrome/browser/task_manager/web_contents_resource_provider.h" |
29 #include "chrome/browser/ui/browser_navigator.h" | 31 #include "chrome/browser/ui/browser_navigator.h" |
32 #include "chrome/browser/ui/user_manager.h" | |
30 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
31 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
32 #include "chrome/grit/generated_resources.h" | 35 #include "chrome/grit/generated_resources.h" |
33 #include "components/nacl/browser/nacl_browser.h" | 36 #include "components/nacl/browser/nacl_browser.h" |
34 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/browser/gpu_data_manager.h" | 38 #include "content/public/browser/gpu_data_manager.h" |
36 #include "content/public/browser/gpu_data_manager_observer.h" | 39 #include "content/public/browser/gpu_data_manager_observer.h" |
37 #include "content/public/browser/resource_request_info.h" | 40 #include "content/public/browser/resource_request_info.h" |
38 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
39 #include "content/public/browser/web_contents_delegate.h" | 42 #include "content/public/browser/web_contents_delegate.h" |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1520 void TaskManager::ModelChanged() { | 1523 void TaskManager::ModelChanged() { |
1521 model_->ModelChanged(); | 1524 model_->ModelChanged(); |
1522 } | 1525 } |
1523 | 1526 |
1524 // static | 1527 // static |
1525 TaskManager* TaskManager::GetInstance() { | 1528 TaskManager* TaskManager::GetInstance() { |
1526 return Singleton<TaskManager>::get(); | 1529 return Singleton<TaskManager>::get(); |
1527 } | 1530 } |
1528 | 1531 |
1529 void TaskManager::OpenAboutMemory(chrome::HostDesktopType desktop_type) { | 1532 void TaskManager::OpenAboutMemory(chrome::HostDesktopType desktop_type) { |
1533 Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy(); | |
1534 if (profile->IsGuestSession()) { | |
noms (inactive)
2014/10/08 21:06:08
Hmmmm so what happens if you open the task manager
Mike Lerman
2014/10/09 14:02:45
That's why there's a second condition that verifie
noms (inactive)
2014/10/09 16:45:13
Ah, got it. Then would you mind combining the two
Mike Lerman
2014/10/09 17:17:20
Done.
| |
1535 PrefService* local_state = g_browser_process->local_state(); | |
1536 if (!local_state->GetBoolean(prefs::kBrowserGuestModeEnabled)) { | |
1537 UserManager::Show(base::FilePath(), | |
1538 profiles::USER_MANAGER_NO_TUTORIAL, | |
1539 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_MEMORY); | |
1540 return; | |
1541 } | |
1542 } | |
1543 | |
1530 chrome::NavigateParams params( | 1544 chrome::NavigateParams params( |
1531 ProfileManager::GetLastUsedProfileAllowedByPolicy(), | 1545 ProfileManager::GetLastUsedProfileAllowedByPolicy(), |
1532 GURL(chrome::kChromeUIMemoryURL), | 1546 GURL(chrome::kChromeUIMemoryURL), |
1533 ui::PAGE_TRANSITION_LINK); | 1547 ui::PAGE_TRANSITION_LINK); |
1534 params.disposition = NEW_FOREGROUND_TAB; | 1548 params.disposition = NEW_FOREGROUND_TAB; |
1535 params.host_desktop_type = desktop_type; | 1549 params.host_desktop_type = desktop_type; |
1536 chrome::Navigate(¶ms); | 1550 chrome::Navigate(¶ms); |
1537 } | 1551 } |
1538 | 1552 |
1539 TaskManager::TaskManager() | 1553 TaskManager::TaskManager() |
1540 : model_(new TaskManagerModel(this)) { | 1554 : model_(new TaskManagerModel(this)) { |
1541 } | 1555 } |
1542 | 1556 |
1543 TaskManager::~TaskManager() { | 1557 TaskManager::~TaskManager() { |
1544 } | 1558 } |
OLD | NEW |