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

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.cc

Issue 197773004: Move avatar holder code to ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" 5 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/desktop_background/user_wallpaper_delegate.h" 10 #include "ash/desktop_background/user_wallpaper_delegate.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 aura::Window* window) { 366 aura::Window* window) {
367 WindowToEntryMap::iterator it = window_to_entry_.find(window); 367 WindowToEntryMap::iterator it = window_to_entry_.find(window);
368 // If the window is not owned by anyone it is shown on all desktops and we 368 // If the window is not owned by anyone it is shown on all desktops and we
369 // return the empty string. 369 // return the empty string.
370 if (it == window_to_entry_.end()) 370 if (it == window_to_entry_.end())
371 return base::EmptyString(); 371 return base::EmptyString();
372 // Otherwise we ask the object for its desktop. 372 // Otherwise we ask the object for its desktop.
373 return it->second->show_for_user(); 373 return it->second->show_for_user();
374 } 374 }
375 375
376 void MultiUserWindowManagerChromeOS::AddUser(Profile* profile) { 376 void MultiUserWindowManagerChromeOS::AddUser(content::BrowserContext* context) {
377 Profile* profile = Profile::FromBrowserContext(context);
377 const std::string& user_id = multi_user_util::GetUserIDFromProfile(profile); 378 const std::string& user_id = multi_user_util::GetUserIDFromProfile(profile);
378 if (user_id_to_app_observer_.find(user_id) != user_id_to_app_observer_.end()) 379 if (user_id_to_app_observer_.find(user_id) != user_id_to_app_observer_.end())
379 return; 380 return;
380 381
381 user_id_to_app_observer_[user_id] = new AppObserver(user_id); 382 user_id_to_app_observer_[user_id] = new AppObserver(user_id);
382 apps::AppWindowRegistry::Get(profile) 383 apps::AppWindowRegistry::Get(profile)
383 ->AddObserver(user_id_to_app_observer_[user_id]); 384 ->AddObserver(user_id_to_app_observer_[user_id]);
384 385
385 // Account all existing application windows of this user accordingly. 386 // Account all existing application windows of this user accordingly.
386 const apps::AppWindowRegistry::AppWindowList& app_windows = 387 const apps::AppWindowRegistry::AppWindowList& app_windows =
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 window->Show(); 863 window->Show();
863 else 864 else
864 window->Hide(); 865 window->Hide();
865 866
866 // Make sure that animations have no influence on the window state after the 867 // Make sure that animations have no influence on the window state after the
867 // call. 868 // call.
868 DCHECK_EQ(visible, window->IsVisible()); 869 DCHECK_EQ(visible, window->IsVisible());
869 } 870 }
870 871
871 } // namespace chrome 872 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698