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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc

Issue 2910773002: cros: CustomFrameViewAsh avatar icon from a window prop (Closed)
Patch Set: add test Created 3 years, 7 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/ash/multi_user/multi_user_window_manager_chromeos.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
index 99a8b0763eadb9ce24fdf5bbb9f438f9d4d2f6e5..ab990c92cf68d2096b62c5468010101c670a8b66 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
+#include <set>
+#include <vector>
+
#include "ash/media_controller.h"
#include "ash/multi_profile_uma.h"
#include "ash/public/cpp/shell_window_ids.h"
@@ -23,6 +26,7 @@
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.h"
#include "chrome/browser/ui/ash/session_controller_client.h"
+#include "chrome/browser/ui/ash/session_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
@@ -526,6 +530,25 @@ bool MultiUserWindowManagerChromeOS::ShowWindowForUserIntern(
WindowToEntryMap::iterator it = window_to_entry_.find(window);
it->second->set_show_for_user(account_id);
+ // Show avatar icon on the teleported window for separated mode.
+ if (GetMultiProfileMode() == MULTI_PROFILE_MODE_SEPARATED) {
+ // Tests could either not have a UserManager or the UserManager does not
+ // know the window owner.
+ const user_manager::User* const window_owner =
+ user_manager::UserManager::IsInitialized()
+ ? user_manager::UserManager::Get()->FindUser(owner)
+ : nullptr;
+
+ const bool teleported = !IsWindowOnDesktopOfUser(window, owner);
+ if (window_owner && teleported) {
+ window->SetProperty(
+ aura::client::kAvatarIconKey,
+ new gfx::ImageSkia(GetAvatarImageForUser(window_owner)));
+ } else {
+ window->ClearProperty(aura::client::kAvatarIconKey);
+ }
+ }
+
// Show the window if the added user is the current one.
if (account_id == current_account_id_) {
// Only show the window if it should be shown according to its state.

Powered by Google App Engine
This is Rietveld 408576698