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

Side by Side Diff: chrome/browser/task_manager/task_manager.cc

Issue 631163004: Mac - show user manager before opening browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark's post-test comments Created 6 years, 1 month 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/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 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 void TaskManager::ModelChanged() { 1522 void TaskManager::ModelChanged() {
1520 model_->ModelChanged(); 1523 model_->ModelChanged();
1521 } 1524 }
1522 1525
1523 // static 1526 // static
1524 TaskManager* TaskManager::GetInstance() { 1527 TaskManager* TaskManager::GetInstance() {
1525 return Singleton<TaskManager>::get(); 1528 return Singleton<TaskManager>::get();
1526 } 1529 }
1527 1530
1528 void TaskManager::OpenAboutMemory(chrome::HostDesktopType desktop_type) { 1531 void TaskManager::OpenAboutMemory(chrome::HostDesktopType desktop_type) {
1532 Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy();
1533 if (profile->IsGuestSession() && !g_browser_process->local_state()->
1534 GetBoolean(prefs::kBrowserGuestModeEnabled)) {
1535 UserManager::Show(base::FilePath(),
1536 profiles::USER_MANAGER_NO_TUTORIAL,
1537 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_MEMORY);
1538 return;
1539 }
1540
1529 chrome::NavigateParams params( 1541 chrome::NavigateParams params(
1530 ProfileManager::GetLastUsedProfileAllowedByPolicy(), 1542 profile, GURL(chrome::kChromeUIMemoryURL), ui::PAGE_TRANSITION_LINK);
1531 GURL(chrome::kChromeUIMemoryURL),
1532 ui::PAGE_TRANSITION_LINK);
1533 params.disposition = NEW_FOREGROUND_TAB; 1543 params.disposition = NEW_FOREGROUND_TAB;
1534 params.host_desktop_type = desktop_type; 1544 params.host_desktop_type = desktop_type;
1535 chrome::Navigate(&params); 1545 chrome::Navigate(&params);
1536 } 1546 }
1537 1547
1538 TaskManager::TaskManager() 1548 TaskManager::TaskManager()
1539 : model_(new TaskManagerModel(this)) { 1549 : model_(new TaskManagerModel(this)) {
1540 } 1550 }
1541 1551
1542 TaskManager::~TaskManager() { 1552 TaskManager::~TaskManager() {
1543 } 1553 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698