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

Unified 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: noms nits Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_window.cc ('k') | chrome/browser/ui/chrome_pages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/task_manager.cc
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 6739f466fe552fe68b57449a4fae6a38be907291..279795c52cc149d4cd0578a54b77406dd624ff73 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -8,6 +8,7 @@
#include "base/i18n/number_formatting.h"
#include "base/i18n/rtl.h"
#include "base/prefs/pref_registry_simple.h"
+#include "base/prefs/pref_service.h"
#include "base/process/process_metrics.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
@@ -16,6 +17,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/task_manager/background_information.h"
#include "chrome/browser/task_manager/browser_process_resource_provider.h"
#include "chrome/browser/task_manager/child_process_resource_provider.h"
@@ -27,6 +29,7 @@
#include "chrome/browser/task_manager/tab_contents_information.h"
#include "chrome/browser/task_manager/web_contents_resource_provider.h"
#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/user_manager.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
@@ -1526,10 +1529,17 @@ TaskManager* TaskManager::GetInstance() {
}
void TaskManager::OpenAboutMemory(chrome::HostDesktopType desktop_type) {
+ Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy();
+ if (profile->IsGuestSession() && !g_browser_process->local_state()->
+ GetBoolean(prefs::kBrowserGuestModeEnabled)) {
+ UserManager::Show(base::FilePath(),
+ profiles::USER_MANAGER_NO_TUTORIAL,
+ profiles::USER_MANAGER_SELECT_PROFILE_CHROME_MEMORY);
+ return;
+ }
+
chrome::NavigateParams params(
- ProfileManager::GetLastUsedProfileAllowedByPolicy(),
- GURL(chrome::kChromeUIMemoryURL),
- ui::PAGE_TRANSITION_LINK);
+ profile, GURL(chrome::kChromeUIMemoryURL), ui::PAGE_TRANSITION_LINK);
params.disposition = NEW_FOREGROUND_TAB;
params.host_desktop_type = desktop_type;
chrome::Navigate(&params);
« no previous file with comments | « chrome/browser/profiles/profile_window.cc ('k') | chrome/browser/ui/chrome_pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698