Commit e8394460 authored by Alex Ilin's avatar Alex Ilin Committed by Chromium LUCI CQ

[Profile creation] Show GAIA sign-in page in dark mode when enabled

GAIA supports dark mode by adding a color_scheme=dark query param.
This CL passes this parameter to the signed-in profile creation flow
when Chrome is displayed in dark mode.

Bug: 1126913
Change-Id: I6a2f024797f2571b16f435bc2e1ea4ba060177c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600897Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840179}
parent d7120730
......@@ -52,6 +52,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/base/url_util.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/flex_layout.h"
......@@ -124,6 +125,14 @@ GURL CreateURLForEntryPoint(ProfilePicker::EntryPoint entry_point) {
}
}
GURL GetSigninURL() {
GURL signin_url = GaiaUrls::GetInstance()->signin_chrome_sync_dice();
if (ui::NativeTheme::GetInstanceForNativeUi()->ShouldUseDarkColors()) {
signin_url = net::AppendQueryParameter(signin_url, "color_scheme", "dark");
}
return signin_url;
}
} // namespace
// static
......@@ -400,8 +409,8 @@ void ProfilePickerView::OnProfileForSigninCreated(
new_profile_contents_ = content::WebContents::Create(
content::WebContents::CreateParams(signed_in_profile_being_created_));
new_profile_contents_->SetDelegate(this);
ShowScreen(new_profile_contents_.get(),
GaiaUrls::GetInstance()->signin_chrome_sync_dice(),
ShowScreen(new_profile_contents_.get(), GetSigninURL(),
/*show_toolbar=*/true);
}
......
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