Commit 40ec7eb1 authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Add ScopedKeepAlive to ProfilePickerView

This prevents Chrome from shutting down while the profile picker is
displayed.

Fixed: 1119369
Change-Id: I1d9df7c66c360dd29984876382b116d5732cb132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375350Reviewed-by: default avatarMonica Basta <msalama@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801694}
parent 4b6a74a1
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "chrome/common/webui_url_constants.h" #include "chrome/common/webui_url_constants.h"
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
#include "chrome/grit/google_chrome_strings.h" #include "chrome/grit/google_chrome_strings.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "content/public/browser/context_menu_params.h" #include "content/public/browser/context_menu_params.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
...@@ -64,7 +65,8 @@ void ProfilePicker::Hide() { ...@@ -64,7 +65,8 @@ void ProfilePicker::Hide() {
} }
ProfilePickerView::ProfilePickerView() ProfilePickerView::ProfilePickerView()
: web_view_(nullptr), initialized_(InitState::kNotInitialized) { : keep_alive_(KeepAliveOrigin::USER_MANAGER_VIEW,
KeepAliveRestartOption::DISABLED) {
SetHasWindowSizeControls(true); SetHasWindowSizeControls(true);
SetButtons(ui::DIALOG_BUTTON_NONE); SetButtons(ui::DIALOG_BUTTON_NONE);
SetTitle(IDS_PRODUCT_NAME); SetTitle(IDS_PRODUCT_NAME);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/profile_picker.h" #include "chrome/browser/ui/profile_picker.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_delegate.h"
#include "ui/views/controls/webview/webview.h" #include "ui/views/controls/webview/webview.h"
#include "ui/views/window/dialog_delegate.h" #include "ui/views/window/dialog_delegate.h"
...@@ -56,8 +57,9 @@ class ProfilePickerView : public views::DialogDelegateView, ...@@ -56,8 +57,9 @@ class ProfilePickerView : public views::DialogDelegateView,
bool HandleContextMenu(content::RenderFrameHost* render_frame_host, bool HandleContextMenu(content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params) override; const content::ContextMenuParams& params) override;
views::WebView* web_view_; ScopedKeepAlive keep_alive_;
InitState initialized_; views::WebView* web_view_ = nullptr;
InitState initialized_ = InitState::kNotInitialized;
base::WeakPtrFactory<ProfilePickerView> weak_ptr_factory_{this}; base::WeakPtrFactory<ProfilePickerView> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ProfilePickerView); DISALLOW_COPY_AND_ASSIGN(ProfilePickerView);
......
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