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

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: Chrome Memory now forces user manager, not Task Manager 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 700456e5de75fbabce67dcddf1c0743423e8eaf6..10feca9b2c0fb772a6a0a8d41cb3fef83a7ce308 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"
@@ -1527,6 +1530,17 @@ TaskManager* TaskManager::GetInstance() {
}
void TaskManager::OpenAboutMemory(chrome::HostDesktopType desktop_type) {
+ Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy();
+ 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.
+ PrefService* local_state = g_browser_process->local_state();
+ if (!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),
« 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