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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 12789010: [win] Change app launcher profile indicator to be a menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 7 years, 9 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
Index: chrome/browser/ui/app_list/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index b4631aa62a20a2af0221c747d238bf6be116c1c2..0f165e79436a9f3c686fd02a12a90f58f3232c41 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -4,12 +4,18 @@
#include "chrome/browser/ui/app_list/app_list_view_delegate.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
#include "chrome/browser/ui/app_list/apps_model_builder.h"
#include "chrome/browser/ui/app_list/chrome_app_list_item.h"
#include "chrome/browser/ui/app_list/chrome_signin_delegate.h"
#include "chrome/browser/ui/app_list/search_builder.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/host_desktop.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/user_metrics.h"
#if defined(USE_ASH)
@@ -101,3 +107,34 @@ void AppListViewDelegate::ViewActivationChanged(bool active) {
gfx::ImageSkia AppListViewDelegate::GetWindowIcon() {
return controller_->GetWindowIcon();
}
+
+string16 AppListViewDelegate::GetCurrentUserName() {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ int profile_index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
+ return cache.GetNameOfProfileAtIndex(profile_index);
+}
+
+string16 AppListViewDelegate::GetCurrentUserEmail() {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ int profile_index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
+ return cache.GetUserNameOfProfileAtIndex(profile_index);
+}
+
+void AppListViewDelegate::OpenSettings() {
+ ExtensionService* service = profile_->GetExtensionService();
+ DCHECK(service);
+ const extensions::Extension* extension = service->GetInstalledExtension(
+ extension_misc::kSettingsAppId);
+ DCHECK(extension);
+ controller_->ActivateApp(profile_, extension, 0);
+}
+
+void AppListViewDelegate::OpenFeedback() {
+ chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow(
+ controller_->GetAppListWindow());
+ Browser* browser = chrome::FindOrCreateTabbedBrowser(
+ profile_, desktop);
+ chrome::ShowFeedbackPage(browser, std::string(), std::string());
+}

Powered by Google App Engine
This is Rietveld 408576698