forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ProfilePicker]: Add initial setup for chrome://profile-picker
This CL adds an empty page chrome://profile-picker. The page is only available if 'kNewProfilePicker' feature flag is enabled. Bug: 1063856 Change-Id: Iec253cb9d28d77455dd684ae48b2d1a7c5feb507 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2156494 Reviewed-by: Samuel Huang <huangs@chromium.org> Reviewed-by: David Roger <droger@chromium.org> Reviewed-by: dpapad <dpapad@chromium.org> Commit-Queue: Monica Basta <msalama@chromium.org> Cr-Commit-Position: refs/heads/master@{#762312}
- Loading branch information
Monica Basta
authored and
Commit Bot
committed
Apr 24, 2020
1 parent
78d4edc
commit b283c8e
Showing
13 changed files
with
133 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://crbug.com/1063856 | ||
|
||
msalama@chromium.org |
8 changes: 8 additions & 0 deletions
8
chrome/browser/resources/signin/profile_picker/profile_picker.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!doctype html> | ||
<html dir="$i18n{textdirection}" lang="$i18n{language}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
chrome/browser/resources/signin/profile_picker/profile_picker_resources.grd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false"> | ||
<outputs> | ||
<output filename="grit/profile_picker_resources.h" type="rc_header"> | ||
<emit emit_type='prepend'></emit> | ||
</output> | ||
<output filename="grit/profile_picker_resources_map.cc" | ||
type="resource_file_map_source" /> | ||
<output filename="grit/profile_picker_resources_map.h" | ||
type="resource_map_header" /> | ||
<output filename="profile_picker_resources.pak" type="data_package" /> | ||
</outputs> | ||
<release seq="1"> | ||
<structures> | ||
<structure | ||
name="IDR_PROFILE_PICKER_PROFILE_PICKER_HTML" | ||
file="profile_picker.html" | ||
type="chrome_html" | ||
compress="false"/> | ||
</structures> | ||
</release> | ||
</grit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ui/webui/signin/profile_picker_ui.h" | ||
|
||
#include "chrome/browser/profiles/profile.h" | ||
#include "chrome/browser/ui/webui/webui_util.h" | ||
#include "chrome/common/webui_url_constants.h" | ||
#include "chrome/grit/profile_picker_resources.h" | ||
#include "chrome/grit/profile_picker_resources_map.h" | ||
#include "content/public/browser/web_ui_data_source.h" | ||
|
||
ProfilePickerUI::ProfilePickerUI(content::WebUI* web_ui) | ||
: content::WebUIController(web_ui) { | ||
Profile* profile = Profile::FromWebUI(web_ui); | ||
content::WebUIDataSource* html_source = | ||
content::WebUIDataSource::Create(chrome::kChromeUIProfilePickerHost); | ||
|
||
std::string generated_path = | ||
"@out_folder@/gen/chrome/browser/resources/signin/profile_picker/"; | ||
webui::SetupWebUIDataSource( | ||
html_source, | ||
base::make_span(kProfilePickerResources, kProfilePickerResourcesSize), | ||
generated_path, IDR_PROFILE_PICKER_PROFILE_PICKER_HTML); | ||
|
||
content::WebUIDataSource::Add(profile, html_source); | ||
} | ||
|
||
ProfilePickerUI::~ProfilePickerUI() = default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_PICKER_UI_H_ | ||
#define CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_PICKER_UI_H_ | ||
|
||
#include "content/public/browser/web_ui_controller.h" | ||
|
||
// The WebUI controller for chrome://profile-picker/. | ||
class ProfilePickerUI : public content::WebUIController { | ||
public: | ||
explicit ProfilePickerUI(content::WebUI* web_ui); | ||
~ProfilePickerUI() override; | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(ProfilePickerUI); | ||
}; | ||
|
||
#endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_PICKER_UI_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters