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

Unified Diff: chrome/browser/task_management/providers/task.cc

Issue 1439213004: Fix various TaskManager bugs and add new enhancements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: auto*& --> auto* Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_management/providers/task.cc
diff --git a/chrome/browser/task_management/providers/task.cc b/chrome/browser/task_management/providers/task.cc
index 849fafd5f67b783eb54d0d4c110039678c257726..025175deeaff8262c8bbcdfedc8b325831ac6ea8 100644
--- a/chrome/browser/task_management/providers/task.cc
+++ b/chrome/browser/task_management/providers/task.cc
@@ -4,6 +4,10 @@
#include "chrome/browser/task_management/providers/task.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/task_management/task_manager_observer.h"
namespace task_management {
@@ -31,6 +35,19 @@ Task::Task(const base::string16& title,
Task::~Task() {
}
+// static
+base::string16 Task::GetProfileNameFromProfile(Profile* profile) {
+ DCHECK(profile);
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ size_t index =
+ cache.GetIndexOfProfileWithPath(profile->GetOriginalProfile()->GetPath());
+ if (index != std::string::npos)
+ return cache.GetNameOfProfileAtIndex(index);
+
+ return base::string16();
+}
+
void Task::Activate() {
}

Powered by Google App Engine
This is Rietveld 408576698