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

Unified Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.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/login_display_host_impl.cc
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
index ae9d5658b54785dccebd2a9b6c24d4c10a5518a3..5c4fce3c83d250d63225ef92f8d70d6efc836a47 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
@@ -56,6 +56,9 @@
#include "chrome/browser/chromeos/ui/focus_ring_controller.h"
#include "chrome/browser/lifetime/application_lifetime.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 "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
@@ -1018,6 +1021,13 @@ void LoginDisplayHostImpl::InitLoginWindowAndView() {
params.parent =
ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
ash::kShellWindowId_LockScreenContainer);
oshima 2015/09/10 00:20:38 this parent will never have associated profile. Th
+ // 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
+ // 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);
login_window_ = new views::Widget;
params.delegate = new LoginWidgetDelegate(login_window_);
login_window_->Init(params);

Powered by Google App Engine
This is Rietveld 408576698