Skip to content

Commit

Permalink
Revert "Move //chromeos/components/multidevice/debug_webui to //ash/w…
Browse files Browse the repository at this point in the history
…ebui"

This reverts commit 1258ffe.

Reason for revert: Possibly causes GRIT to run out of reserved IDs.
See https://crbug.com/1289069

Original change's description:
> Move //chromeos/components/multidevice/debug_webui to //ash/webui
>
> Codes in //chromeos/components/multidevice/debug_webui are
> ChromeOS-specific WebUI and depends on //content, so it is moved to
> //ash/webui and renames to multidevice_debug.
>
> Related resource IDs are separates to the newly created grd file under
> //ash/webui/multidevice_debug/resources from multidevice_resources.grdp.
> And they have prefix IDR_MULTIDEVICE_DEBUG_.*.
>
> And lint error is fixed to pass a presubmit check of ash/webui.
>
> This CL is part of the Chrome OS source code directory migration:
> https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.
>
> Bug: 1164001
> Change-Id: Idfeaeec8dbd125c27376800de2ec1d3bf0e96a1c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3347338
> Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Owners-Override: Hidehiko Abe <hidehiko@chromium.org>
> Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#961248}

Bug: 1164001
Change-Id: I678e69539f72bff59ccabc8a7d35999e8d68058d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3403660
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Owners-Override: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961293}
  • Loading branch information
irori authored and Chromium LUCI CQ committed Jan 20, 2022
1 parent f33730c commit 03e5b7f
Show file tree
Hide file tree
Showing 30 changed files with 170 additions and 198 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,7 @@ if (enable_js_type_check) {
if (is_chromeos_ash) {
data_deps += [
"ash/webui:closure_compile",
"chromeos/components:closure_compile",
"ui/file_manager:closure_compile",
]
}
Expand Down
1 change: 0 additions & 1 deletion ash/webui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ group("closure_compile") {
"//ash/webui/firmware_update_ui:closure_compile",
"//ash/webui/help_app_ui:closure_compile",
"//ash/webui/media_app_ui:closure_compile",
"//ash/webui/multidevice_debug/resources:closure_compile",
"//ash/webui/os_feedback_ui:closure_compile",
"//ash/webui/print_management:closure_compile",
"//ash/webui/projector_app/resources:closure_compile",
Expand Down
1 change: 0 additions & 1 deletion ash/webui/multidevice_debug/OWNERS

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions ash/webui/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,3 @@ grit("connectivity_diagnostics_resources") {

output_dir = "$root_gen_dir/ash"
}

grit("multidevice_debug_resources") {
source =
"//ash/webui/multidevice_debug/resources/multidevice_debug_resources.grd"

outputs = [
"grit/ash_multidevice_debug_resources.h",
"grit/ash_multidevice_debug_resources_map.cc",
"grit/ash_multidevice_debug_resources_map.h",
"ash_multidevice_debug_resources.pak",
]

output_dir = "$root_gen_dir/ash"
}
2 changes: 1 addition & 1 deletion chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2442,7 +2442,6 @@ static_library("browser") {
"//ash/webui/help_app_ui/search:mojo_bindings",
"//ash/webui/media_app_ui",
"//ash/webui/media_app_ui:mojo_bindings",
"//ash/webui/multidevice_debug",
"//ash/webui/personalization_app",
"//ash/webui/personalization_app/mojom",
"//ash/webui/print_management",
Expand Down Expand Up @@ -2472,6 +2471,7 @@ static_library("browser") {
"//chromeos/components/local_search_service",
"//chromeos/components/local_search_service/public/cpp:cpp",
"//chromeos/components/local_search_service/public/mojom",
"//chromeos/components/multidevice/debug_webui",
"//chromeos/components/onc",
"//chromeos/components/quick_answers/public/cpp:cpp",
"//chromeos/components/quick_answers/public/cpp:prefs",
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chrome_browser_interface_binders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
#include "ash/webui/help_app_ui/search/search.mojom.h"
#include "ash/webui/media_app_ui/media_app_ui.h"
#include "ash/webui/media_app_ui/media_app_ui.mojom.h"
#include "ash/webui/multidevice_debug/proximity_auth_ui.h"
#include "ash/webui/personalization_app/mojom/personalization_app.mojom.h"
#include "ash/webui/personalization_app/personalization_app_ui.h"
#include "ash/webui/print_management/mojom/printing_manager.mojom.h"
Expand Down Expand Up @@ -241,6 +240,7 @@
#include "chrome/browser/ui/webui/settings/chromeos/search/search.mojom.h"
#include "chrome/browser/ui/webui/settings/chromeos/search/user_action_recorder.mojom.h"
#include "chromeos/components/local_search_service/public/mojom/index.mojom.h"
#include "chromeos/components/multidevice/debug_webui/proximity_auth_ui.h"
#include "chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom.h"
#include "chromeos/services/cellular_setup/public/mojom/cellular_setup.mojom.h"
#include "chromeos/services/cellular_setup/public/mojom/esim_manager.mojom.h"
Expand Down Expand Up @@ -863,7 +863,7 @@ void PopulateChromeWebUIFrameBinders(

RegisterWebUIControllerInterfaceBinder<
chromeos::multidevice_setup::mojom::MultiDeviceSetup, chromeos::OobeUI,
ash::multidevice::ProximityAuthUI,
chromeos::multidevice::ProximityAuthUI,
chromeos::multidevice_setup::MultiDeviceSetupDialogUI>(map);

RegisterWebUIControllerInterfaceBinder<
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2927,7 +2927,6 @@ static_library("ui") {
"//ash/webui/help_app_ui",
"//ash/webui/help_app_ui/search:mojo_bindings",
"//ash/webui/media_app_ui",
"//ash/webui/multidevice_debug",
"//ash/webui/network_ui:network_diagnostics_resource_provider",
"//ash/webui/network_ui:network_health_resource_provider",
"//ash/webui/network_ui:traffic_counters_resource_provider",
Expand Down Expand Up @@ -2985,6 +2984,7 @@ static_library("ui") {
"//chromeos/components/local_search_service/public/cpp",
"//chromeos/components/local_search_service/public/mojom",
"//chromeos/components/multidevice",
"//chromeos/components/multidevice/debug_webui",
"//chromeos/components/multidevice/logging",
"//chromeos/components/onc",
"//chromeos/components/quick_answers",
Expand Down
17 changes: 9 additions & 8 deletions chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@
#include "ash/webui/help_app_ui/url_constants.h"
#include "ash/webui/media_app_ui/media_app_ui.h"
#include "ash/webui/media_app_ui/url_constants.h"
#include "ash/webui/multidevice_debug/proximity_auth_ui.h"
#include "ash/webui/multidevice_debug/url_constants.h"
#include "ash/webui/os_feedback_ui/os_feedback_ui.h"
#include "ash/webui/os_feedback_ui/url_constants.h"
#include "ash/webui/personalization_app/personalization_app_ui.h"
Expand Down Expand Up @@ -256,6 +254,8 @@
#include "chrome/browser/ui/webui/nearby_internals/nearby_internals_ui.h"
#include "chrome/browser/ui/webui/nearby_share/nearby_share_dialog_ui.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_ui.h"
#include "chromeos/components/multidevice/debug_webui/proximity_auth_ui.h"
#include "chromeos/components/multidevice/debug_webui/url_constants.h"
#include "chromeos/services/multidevice_setup/multidevice_setup_service.h"
#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
#include "chromeos/services/network_health/public/mojom/network_diagnostics.mojom.h" // nogncheck
Expand Down Expand Up @@ -543,11 +543,12 @@ void BindMultiDeviceSetup(

// Special case for chrome://proximity_auth.
template <>
WebUIController* NewWebUI<ash::multidevice::ProximityAuthUI>(WebUI* web_ui,
const GURL& url) {
WebUIController* NewWebUI<chromeos::multidevice::ProximityAuthUI>(
WebUI* web_ui,
const GURL& url) {
content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
return new ash::multidevice::ProximityAuthUI(
return new chromeos::multidevice::ProximityAuthUI(
web_ui,
ash::device_sync::DeviceSyncClientFactory::GetForProfile(
Profile::FromBrowserContext(browser_context)),
Expand Down Expand Up @@ -911,9 +912,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
if (url.host_piece() == ash::kChromeUIFirmwareUpdateAppHost)
return &NewWebUI<ash::FirmwareUpdateAppUI>;
}
if (url.host_piece() == ash::multidevice::kChromeUIProximityAuthHost &&
if (url.host_piece() == chromeos::multidevice::kChromeUIProximityAuthHost &&
!profile->IsOffTheRecord()) {
return &NewWebUI<ash::multidevice::ProximityAuthUI>;
return &NewWebUI<chromeos::multidevice::ProximityAuthUI>;
}
if (url.host_piece() == chrome::kChromeUIInternetConfigDialogHost)
return &NewWebUI<chromeos::InternetConfigDialogUI>;
Expand Down Expand Up @@ -1444,7 +1445,7 @@ std::vector<GURL> ChromeWebUIControllerFactory::GetListOfAcceptableURLs() {
GURL(chrome::kChromeUIOSCreditsURL), GURL(chrome::kOsUIOSSettingsURL),
GURL(chrome::kChromeUIPowerUrl),
GURL(chrome::kChromeUIPrintManagementUrl),
GURL(ash::multidevice::kChromeUIProximityAuthURL),
GURL(chromeos::multidevice::kChromeUIProximityAuthURL),
GURL(chrome::kOsUIRestartURL), GURL(chrome::kChromeUIScanningAppURL),
GURL(chrome::kOsUIScanningAppURL), GURL(chrome::kChromeUISetTimeURL),
GURL(chrome::kChromeUIOSSettingsURL), GURL(chrome::kChromeUISettingsURL),
Expand Down
2 changes: 0 additions & 2 deletions chrome/chrome_paks.gni
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ template("chrome_extra_paks") {
"$root_gen_dir/ash/ash_firmware_update_app_resources.pak",
"$root_gen_dir/ash/ash_help_app_resources.pak",
"$root_gen_dir/ash/ash_media_app_resources.pak",
"$root_gen_dir/ash/ash_multidevice_debug_resources.pak",
"$root_gen_dir/ash/ash_os_feedback_resources.pak",
"$root_gen_dir/ash/ash_personalization_app_resources.pak",
"$root_gen_dir/ash/ash_print_management_resources.pak",
Expand Down Expand Up @@ -264,7 +263,6 @@ template("chrome_extra_paks") {
"//ash/webui/resources:help_app_resources",
"//ash/webui/resources:media_app_bundle_resources",
"//ash/webui/resources:media_app_resources",
"//ash/webui/resources:multidevice_debug_resources",
"//ash/webui/resources:os_feedback_resources",
"//ash/webui/resources:personalization_app_resources",
"//ash/webui/resources:print_management_resources",
Expand Down
10 changes: 10 additions & 0 deletions chromeos/components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ test("chromeos_components_unittests") {
"//ui/resources:ui_test_pak_data",
]
}

group("closure_compile") {
testonly = true

# TODO(https://crbug.com/1164001): closure_compile deps should be moved to
# the appropriate place during the code migration project.
deps = [
"//chromeos/components/multidevice/debug_webui/resources:closure_compile",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
assert(is_chromeos, "Proximity Auth is Chrome OS only")

assert(is_chromeos_ash, "Proximity Auth is ash-chrome only")

static_library("multidevice_debug") {
static_library("debug_webui") {
sources = [
"proximity_auth_ui.cc",
"proximity_auth_ui.h",
Expand All @@ -18,10 +16,10 @@ static_library("multidevice_debug") {

deps = [
"//ash/constants",
"//ash/webui/resources:multidevice_debug_resources",
"//base",
"//base:i18n",
"//chromeos/components/multidevice/logging",
"//chromeos/resources",
"//chromeos/services/device_sync/proto",
"//chromeos/services/device_sync/proto:util",
"//chromeos/services/device_sync/public/cpp",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include_rules = [
"+chromeos/services/device_sync/proto",
"+chromeos/services/device_sync/public/cpp",
"+chromeos/grit/chromeos_resources.h",
"+chromeos/services/multidevice_setup/public/mojom",
"+content/public/browser",
"+device/bluetooth",
"+ui/webui",
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/webui/multidevice_debug/proximity_auth_ui.h"
#include "chromeos/components/multidevice/debug_webui/proximity_auth_ui.h"

#include <memory>

#include "ash/grit/ash_multidevice_debug_resources.h"
#include "ash/webui/multidevice_debug/proximity_auth_webui_handler.h"
#include "ash/webui/multidevice_debug/url_constants.h"
#include "base/bind.h"
#include "chromeos/components/multidevice/debug_webui/proximity_auth_webui_handler.h"
#include "chromeos/components/multidevice/debug_webui/url_constants.h"
#include "chromeos/grit/chromeos_resources.h"
#include "chromeos/services/device_sync/public/cpp/device_sync_client.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"

namespace ash {
namespace chromeos {

namespace multidevice {

Expand All @@ -28,16 +28,16 @@ ProximityAuthUI::ProximityAuthUI(
multidevice_setup_binder_(std::move(multidevice_setup_binder)) {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(kChromeUIProximityAuthHost);
source->SetDefaultResource(IDR_MULTIDEVICE_DEBUG_INDEX_HTML);
source->AddResourcePath("common.css", IDR_MULTIDEVICE_DEBUG_COMMON_CSS);
source->AddResourcePath("webui.js", IDR_MULTIDEVICE_DEBUG_WEBUI_JS);
source->AddResourcePath("logs.js", IDR_MULTIDEVICE_DEBUG_LOGS_JS);
source->SetDefaultResource(IDR_MULTIDEVICE_INDEX_HTML);
source->AddResourcePath("common.css", IDR_MULTIDEVICE_COMMON_CSS);
source->AddResourcePath("webui.js", IDR_MULTIDEVICE_WEBUI_JS);
source->AddResourcePath("logs.js", IDR_MULTIDEVICE_LOGS_JS);
source->AddResourcePath("proximity_auth.html",
IDR_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_HTML);
IDR_MULTIDEVICE_PROXIMITY_AUTH_HTML);
source->AddResourcePath("proximity_auth.css",
IDR_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_CSS);
IDR_MULTIDEVICE_PROXIMITY_AUTH_CSS);
source->AddResourcePath("proximity_auth.js",
IDR_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_JS);
IDR_MULTIDEVICE_PROXIMITY_AUTH_JS);

content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
Expand All @@ -58,4 +58,4 @@ WEB_UI_CONTROLLER_TYPE_IMPL(ProximityAuthUI)

} // namespace multidevice

} // namespace ash
} // namespace chromeos
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_WEBUI_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_UI_H_
#define ASH_WEBUI_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_UI_H_
#ifndef CHROMEOS_COMPONENTS_MULTIDEVICE_DEBUG_WEBUI_PROXIMITY_AUTH_UI_H_
#define CHROMEOS_COMPONENTS_MULTIDEVICE_DEBUG_WEBUI_PROXIMITY_AUTH_UI_H_

// TODO(https://crbug.com/1164001): move to forward declaration
#include "chromeos/services/device_sync/public/cpp/device_sync_client.h"
#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
#include "content/public/browser/web_ui_controller.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "ui/webui/mojo_web_ui_controller.h"

namespace ash {
namespace chromeos {

namespace device_sync {
class DeviceSyncClient;
} // namespace device_sync

namespace multidevice {

// The WebUI controller for chrome://proximity-auth.
class ProximityAuthUI : public ui::MojoWebUIController {
public:
using MultiDeviceSetupBinder = base::RepeatingCallback<void(
mojo::PendingReceiver<
chromeos::multidevice_setup::mojom::MultiDeviceSetup>)>;
mojo::PendingReceiver<multidevice_setup::mojom::MultiDeviceSetup>)>;

// Note: |web_ui| is not owned by this instance and must outlive this
// instance.
Expand All @@ -37,8 +38,8 @@ class ProximityAuthUI : public ui::MojoWebUIController {
// Instantiates implementor of the mojom::MultiDeviceSetup mojo interface
// passing the pending receiver that will be internally bound.
void BindInterface(
mojo::PendingReceiver<
chromeos::multidevice_setup::mojom::MultiDeviceSetup> receiver);
mojo::PendingReceiver<multidevice_setup::mojom::MultiDeviceSetup>
receiver);

private:
const MultiDeviceSetupBinder multidevice_setup_binder_;
Expand All @@ -48,6 +49,6 @@ class ProximityAuthUI : public ui::MojoWebUIController {

} // namespace multidevice

} // namespace ash
} // namespace chromeos

#endif // ASH_WEBUI_MULTIDEVICE_DEBUG_PROXIMITY_AUTH_UI_H_
#endif // CHROMEOS_COMPONENTS_MULTIDEVICE_DEBUG_WEBUI_PROXIMITY_AUTH_UI_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/webui/multidevice_debug/proximity_auth_webui_handler.h"
#include "chromeos/components/multidevice/debug_webui/proximity_auth_webui_handler.h"

#include <algorithm>
#include <memory>
Expand All @@ -24,15 +24,12 @@
#include "content/public/browser/web_ui.h"
#include "device/bluetooth/public/cpp/bluetooth_uuid.h"

namespace ash {
namespace chromeos {

namespace multidevice {

namespace {

// TODO(https://crbug.com/1164001): remove when device_sync moved to ash
namespace device_sync = ::chromeos::device_sync;

constexpr const multidevice::SoftwareFeature kAllSoftareFeatures[] = {
multidevice::SoftwareFeature::kBetterTogetherHost,
multidevice::SoftwareFeature::kBetterTogetherClient,
Expand Down Expand Up @@ -436,4 +433,4 @@ void ProximityAuthWebUIHandler::NotifyGotLocalState(

} // namespace multidevice

} // namespace ash
} // namespace chromeos
Loading

0 comments on commit 03e5b7f

Please sign in to comment.