Chromium Code Reviews| Index: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| index c1694fb8c8f6d7b0450e2d0d96d226b4a1220567..90af0a58a68d254bdfc269938e3ededecf440380 100644 |
| --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| @@ -6,8 +6,11 @@ |
| #include <algorithm> |
| +#include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/search/search.h" |
| #include "chrome/browser/themes/theme_properties.h" |
| +#include "chrome/browser/themes/theme_service.h" |
| +#include "chrome/browser/themes/theme_service_factory.h" |
| #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" |
| #include "components/omnibox/browser/omnibox_view.h" |
| @@ -26,6 +29,10 @@ |
| #include "ui/views/widget/widget.h" |
| #include "ui/views/window/non_client_view.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| +#endif // OS_CHROMEOS |
| + |
| class OmniboxPopupContentsView::AutocompletePopupWidget |
| : public views::Widget, |
| public base::SupportsWeakPtr<AutocompletePopupWidget> { |
| @@ -247,10 +254,25 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() { |
| #else |
| views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| #endif |
| + |
| + // On login screen and logged in as an anonymous user you might not get a |
|
oshima
2015/09/10 00:20:38
Is it impossible to have omnibox in login screen,
|
| + // 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 = nullptr; |
| +#if defined(OS_CHROMEOS) |
| + profile = |
| + multi_user_util::GetProfileFromWindow(popup_parent->GetNativeWindow()); |
| + if (!profile) |
| + profile = ProfileManager::GetActiveUserProfile(); |
| +#else |
| + profile = ProfileManager::GetActiveUserProfile(); |
| +#endif // OS_CHROMEOS |
| + |
| params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| params.parent = popup_parent->GetNativeView(); |
| params.bounds = GetPopupBounds(); |
| params.context = popup_parent->GetNativeWindow(); |
| + params.theme_provider = ThemeServiceFactory::GetForProfile(profile); |
| popup_->Init(params); |
| // Third-party software such as DigitalPersona identity verification can |
| // hook the underlying window creation methods and use SendMessage to |