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

Unified Diff: chrome/browser/chromeos/login/ui/lock_window_aura.cc

Issue 1310183009: Add ability for Widgets to override the DefaultThemeProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only Set ThemeProvider on Top Level Widget Created 5 years, 3 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/chromeos/login/ui/lock_window_aura.cc
diff --git a/chrome/browser/chromeos/login/ui/lock_window_aura.cc b/chrome/browser/chromeos/login/ui/lock_window_aura.cc
index 83d35260e65ca6e30ff10f8293b19bbb5613b05f..cff6a7b33d4c316ba96894ba87e7943e96728268 100644
--- a/chrome/browser/chromeos/login/ui/lock_window_aura.cc
+++ b/chrome/browser/chromeos/login/ui/lock_window_aura.cc
@@ -7,6 +7,10 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "base/command_line.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/themes/theme_service_factory.h"
+#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
@@ -61,6 +65,13 @@ void LockWindowAura::Init() {
params.parent =
ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
ash::kShellWindowId_LockScreenContainer);
+ // On login screen and logged in as an anonymous user you might not get a
+ // profile. Which indicates that multi-user is not active and an anonymous
tdanderson 2015/09/09 17:38:58 nit: change . to , between first two sentences (he
+ // profile is in use. Take the active profile to find the theme.
+ Profile* profile = multi_user_util::GetProfileFromWindow(params.parent);
+ if (!profile)
+ profile = ProfileManager::GetActiveUserProfile();
+ params.theme_provider = ThemeServiceFactory::GetForProfile(profile);
views::Widget::Init(params);
SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE);
}

Powered by Google App Engine
This is Rietveld 408576698