Commit dbb46b5e authored by Yue Li's avatar Yue Li Committed by Commit Bot

Set window owner for Assistant opt-in dialog

Opt-in dialog should be hide/show correctly when switching users.

Bug: 812010
Test: Manual Test
Change-Id: I2a880974e22d1179c564891fc3f46f562de865f2
Reviewed-on: https://chromium-review.googlesource.com/c/1289685Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600972}
parent 836cfcb8
...@@ -11,12 +11,14 @@ ...@@ -11,12 +11,14 @@
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h" #include "chrome/grit/browser_resources.h"
#include "components/arc/arc_prefs.h" #include "components/arc/arc_prefs.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/host_zoom_map.h" #include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_data_source.h"
...@@ -72,8 +74,12 @@ void AssistantOptInDialog::Show( ...@@ -72,8 +74,12 @@ void AssistantOptInDialog::Show(
int container_id = dialog->GetDialogModalType() == ui::MODAL_TYPE_NONE int container_id = dialog->GetDialogModalType() == ui::MODAL_TYPE_NONE
? ash::kShellWindowId_DefaultContainer ? ash::kShellWindowId_DefaultContainer
: ash::kShellWindowId_LockSystemModalContainer; : ash::kShellWindowId_LockSystemModalContainer;
chrome::ShowWebDialogInContainer( auto* window = chrome::ShowWebDialogInContainer(
container_id, ProfileManager::GetActiveUserProfile(), dialog, true); container_id, ProfileManager::GetActiveUserProfile(), dialog, true);
MultiUserWindowManager::GetInstance()->SetWindowOwner(
window,
user_manager::UserManager::Get()->GetActiveUser()->GetAccountId());
} }
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment