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

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: Clang fail 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
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/browser/ui/app_list/search_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2e72c0d53b77a1b2cd4a5f8dddda656fa473215e 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,19 @@
#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/browser/ui/webui/ntp/app_launcher_handler.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/user_metrics.h"
#if defined(USE_ASH)
@@ -101,3 +108,40 @@ void AppListViewDelegate::ViewActivationChanged(bool active) {
gfx::ImageSkia AppListViewDelegate::GetWindowIcon() {
return controller_->GetWindowIcon();
}
+
+string16 AppListViewDelegate::GetCurrentUserName() {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ size_t profile_index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
+ if (profile_index != std::string::npos)
+ return cache.GetNameOfProfileAtIndex(profile_index);
+
+ return string16();
+}
+
+string16 AppListViewDelegate::GetCurrentUserEmail() {
+ ProfileInfoCache& cache =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ size_t profile_index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
+ if (profile_index != std::string::npos)
+ return cache.GetUserNameOfProfileAtIndex(profile_index);
+
+ return string16();
+}
+
+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());
+}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/browser/ui/app_list/search_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698