Commit a98a6642 authored by Jeevan Shikaram's avatar Jeevan Shikaram Committed by Commit Bot

[App Management] Remove stand-alone App Management page.

This CL removes the chrome://app-management host and deletes
related stand-alone page assets.

Bug: 1002782
Change-Id: I0a7f5df7886f1765488d2f6c295f709f48024c31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1804945
Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697436}
parent f165dbda
......@@ -1185,8 +1185,6 @@ jumbo_split_static_library("ui") {
"webui/app_management/app_management_page_handler.h",
"webui/app_management/app_management_shelf_delegate_chromeos.cc",
"webui/app_management/app_management_shelf_delegate_chromeos.h",
"webui/app_management/app_management_ui.cc",
"webui/app_management/app_management_ui.h",
"webui/bookmarks/bookmarks_message_handler.cc",
"webui/bookmarks/bookmarks_message_handler.h",
"webui/bookmarks/bookmarks_ui.cc",
......
......@@ -764,7 +764,6 @@ bool IsHostAllowedInIncognito(const GURL& url) {
// chrome://extensions is on the list because it redirects to
// chrome://settings.
return host != chrome::kChromeUIAppLauncherPageHost &&
host != chrome::kChromeUIAppManagementHost &&
host != chrome::kChromeUISettingsHost &&
#if defined(OS_CHROMEOS)
host != chrome::kChromeUIOSSettingsHost &&
......
// Copyright 2018 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/app_management/app_management_ui.h"
#include <memory>
#include <utility>
#include "base/bind.h"
#include "base/feature_list.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/app_management/app_management_page_handler.h"
#include "chrome/browser/ui/webui/localized_string.h"
#include "chrome/browser/ui/webui/plural_string_handler.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
content::WebUIDataSource* CreateAppManagementUIHTMLSource(Profile* profile) {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUIAppManagementHost);
static constexpr LocalizedString kStrings[] = {
{"appListTitle", IDS_APP_MANAGEMENT_APP_LIST_TITLE},
{"appNoPermission", IDS_APPLICATION_INFO_APP_NO_PERMISSIONS_TEXT},
{"back", IDS_APP_MANAGEMENT_BACK},
{"camera", IDS_APP_MANAGEMENT_CAMERA},
{"contacts", IDS_APP_MANAGEMENT_CONTACTS},
{"controlledByPolicy", IDS_CONTROLLED_SETTING_POLICY},
{"lessApps", IDS_APP_MANAGEMENT_LESS_APPS},
{"location", IDS_APP_MANAGEMENT_LOCATION},
{"microphone", IDS_APP_MANAGEMENT_MICROPHONE},
{"moreApps", IDS_APP_MANAGEMENT_MORE_APPS},
{"moreSettings", IDS_APP_MANAGEMENT_MORE_SETTINGS},
{"noSearchResults", IDS_APP_MANAGEMENT_NO_RESULTS},
{"notifications", IDS_APP_MANAGEMENT_NOTIFICATIONS},
{"notificationSublabel", IDS_APP_MANAGEMENT_NOTIFICATIONS_SUBLABEL},
{"openAndroidSettings", IDS_APP_MANAGEMENT_ANDROID_SETTINGS},
{"openExtensionsSettings", IDS_APP_MANAGEMENT_EXTENSIONS_SETTINGS},
{"openSiteSettings", IDS_APP_MANAGEMENT_SITE_SETTING},
{"permissions", IDS_APP_MANAGEMENT_PERMISSIONS},
{"pinControlledByPolicy", IDS_APP_MANAGEMENT_PIN_ENFORCED_BY_POLICY},
{"pinToShelf", IDS_APP_MANAGEMENT_PIN_TO_SHELF},
{"searchPrompt", IDS_APP_MANAGEMENT_SEARCH_PROMPT},
{"size", IDS_APP_MANAGEMENT_SIZE},
{"storage", IDS_APP_MANAGEMENT_STORAGE},
{"thisAppCan", IDS_APP_MANAGEMENT_THIS_APP_CAN},
{"title", IDS_APP_MANAGEMENT_TITLE},
{"uninstall", IDS_APP_MANAGEMENT_UNINSTALL_APP},
{"version", IDS_APP_MANAGEMENT_VERSION},
};
AddLocalizedStringsBulk(source, kStrings, base::size(kStrings));
#if defined(OS_CHROMEOS)
source->AddBoolean(
"isSupportedArcVersion",
AppManagementPageHandler::IsCurrentArcVersionSupported(profile));
#endif // OS_CHROMEOS
source->AddResourcePath("app_management.mojom-lite.js",
IDR_APP_MANAGEMENT_MOJO_LITE_JS);
source->AddResourcePath("types.mojom-lite.js",
IDR_APP_MANAGEMENT_TYPES_MOJO_LITE_JS);
source->AddResourcePath("bitmap.mojom-lite.js",
IDR_APP_MANAGEMENT_BITMAP_MOJO_LITE_JS);
source->AddResourcePath("image.mojom-lite.js",
IDR_APP_MANAGEMENT_IMAGE_MOJO_LITE_JS);
source->AddResourcePath("image_info.mojom-lite.js",
IDR_APP_MANAGEMENT_IMAGE_INFO_MOJO_LITE_JS);
source->AddResourcePath("app.html", IDR_APP_MANAGEMENT_APP_HTML);
source->AddResourcePath("app.js", IDR_APP_MANAGEMENT_APP_JS);
source->AddResourcePath("expandable_app_list.html",
IDR_APP_MANAGEMENT_EXPANDABLE_APP_LIST_HTML);
source->AddResourcePath("expandable_app_list.js",
IDR_APP_MANAGEMENT_EXPANDABLE_APP_LIST_JS);
source->SetDefaultResource(IDR_APP_MANAGEMENT_INDEX_HTML);
source->UseStringsJs();
return source;
}
} // namespace
///////////////////////////////////////////////////////////////////////////////
//
// AppManagementUI
//
///////////////////////////////////////////////////////////////////////////////
AppManagementUI::AppManagementUI(content::WebUI* web_ui)
: ui::MojoWebUIController(web_ui, true), page_factory_binding_(this) {
Profile* profile = Profile::FromWebUI(web_ui);
// Set up the data source.
content::WebUIDataSource* source = CreateAppManagementUIHTMLSource(profile);
content::WebUIDataSource::Add(profile, source);
AddHandlerToRegistry(base::BindRepeating(
&AppManagementUI::BindPageHandlerFactory, base::Unretained(this)));
auto plural_string_handler = std::make_unique<PluralStringHandler>();
plural_string_handler->AddLocalizedString(
"appListPreview", IDS_APP_MANAGEMENT_APP_LIST_PREVIEW);
web_ui->AddMessageHandler(std::move(plural_string_handler));
}
AppManagementUI::~AppManagementUI() = default;
bool AppManagementUI::IsEnabled() {
return base::FeatureList::IsEnabled(features::kAppManagement);
}
void AppManagementUI::BindPageHandlerFactory(
app_management::mojom::PageHandlerFactoryRequest request) {
if (page_factory_binding_.is_bound()) {
page_factory_binding_.Unbind();
}
page_factory_binding_.Bind(std::move(request));
}
void AppManagementUI::CreatePageHandler(
app_management::mojom::PagePtr page,
app_management::mojom::PageHandlerRequest request) {
DCHECK(page);
page_handler_ = std::make_unique<AppManagementPageHandler>(
std::move(request), std::move(page), Profile::FromWebUI(web_ui()));
}
// Copyright 2018 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_APP_MANAGEMENT_APP_MANAGEMENT_UI_H_
#define CHROME_BROWSER_UI_WEBUI_APP_MANAGEMENT_APP_MANAGEMENT_UI_H_
#include <memory>
#include "base/macros.h"
#include "chrome/browser/ui/webui/app_management/app_management.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "ui/webui/mojo_web_ui_controller.h"
class AppManagementPageHandler;
class AppManagementUI : public ui::MojoWebUIController,
public app_management::mojom::PageHandlerFactory {
public:
explicit AppManagementUI(content::WebUI* web_ui);
~AppManagementUI() override;
static bool IsEnabled();
private:
void BindPageHandlerFactory(
app_management::mojom::PageHandlerFactoryRequest request);
// app_management::mojom::PageHandlerFactory:
void CreatePageHandler(
app_management::mojom::PagePtr page,
app_management::mojom::PageHandlerRequest request) override;
std::unique_ptr<AppManagementPageHandler> page_handler_;
mojo::Binding<app_management::mojom::PageHandlerFactory>
page_factory_binding_;
DISALLOW_COPY_AND_ASSIGN(AppManagementUI);
};
#endif // CHROME_BROWSER_UI_WEBUI_APP_MANAGEMENT_APP_MANAGEMENT_UI_H_
......@@ -114,7 +114,6 @@
#if !defined(OS_ANDROID)
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/ui/webui/app_management/app_management_ui.h"
#include "chrome/browser/ui/webui/management_ui.h"
#include "chrome/browser/ui/webui/media_router/media_router_internals_ui.h"
#include "chrome/browser/ui/webui/web_footer_experiment_ui.h"
......@@ -450,12 +449,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<VersionUI>;
#if !defined(OS_ANDROID)
if (AppManagementUI::IsEnabled() &&
url.host_piece() == chrome::kChromeUIAppManagementHost && profile &&
!profile->IsGuestSession()) {
return &NewWebUI<AppManagementUI>;
}
#if !defined(OS_CHROMEOS)
// AppLauncherPage is not needed on Android or ChromeOS.
if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile &&
......@@ -466,7 +459,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
#endif // !defined(OS_CHROMEOS)
if (profile->IsGuestSession() &&
(url.host_piece() == chrome::kChromeUIAppLauncherPageHost ||
url.host_piece() == chrome::kChromeUIAppManagementHost ||
url.host_piece() == chrome::kChromeUIBookmarksHost ||
url.host_piece() == chrome::kChromeUIHistoryHost ||
url.host_piece() == chrome::kChromeUIExtensionsHost)) {
......@@ -940,10 +932,6 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
if (page_url.host_piece() == chrome::kChromeUIManagementHost)
return ManagementUI::GetFaviconResourceBytes(scale_factor);
// Android doesn't use the App Management page.
if (page_url.host_piece() == chrome::kChromeUIAppManagementHost)
return settings_utils::GetFaviconResourceBytes(scale_factor);
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (page_url.host_piece() == chrome::kChromeUIExtensionsHost) {
return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor);
......
......@@ -23,7 +23,6 @@ const char kChromeUIAccessibilityHost[] = "accessibility";
const char kChromeUIAppIconHost[] = "app-icon";
const char kChromeUIAppIconURL[] = "chrome://app-icon/";
const char kChromeUIAppLauncherPageHost[] = "apps";
const char kChromeUIAppManagementHost[] = "app-management";
const char kChromeUIAppsURL[] = "chrome://apps/";
const char kChromeUIAutofillInternalsHost[] = "autofill-internals";
const char kChromeUIBluetoothInternalsHost[] = "bluetooth-internals";
......
......@@ -31,7 +31,6 @@ extern const char kChromeUIAccessibilityHost[];
extern const char kChromeUIAppIconHost[];
extern const char kChromeUIAppIconURL[];
extern const char kChromeUIAppLauncherPageHost[];
extern const char kChromeUIAppManagementHost[];
extern const char kChromeUIAppsURL[];
extern const char kChromeUIAutofillInternalsHost[];
extern const char kChromeUIBluetoothInternalsHost[];
......
......@@ -4,9 +4,9 @@ Chrome, and especially Chrome OS, has apps, e.g. chat apps and camera apps.
There are a number (lets call it `M`) of different places or app Consumers,
usually UI (user interfaces) related, where users interact with their installed
apps: e.g. launcher, search bar, shelf, New Tab Page, the App Management page,
permissions or settings pages, picking and running default handlers for URLs,
MIME types or intents, etc.
apps: e.g. launcher, search bar, shelf, New Tab Page, the App Management
settings page, permissions or settings pages, picking and running default
handlers for URLs, MIME types or intents, etc.
There is also a different number (`N`) of app platforms or app Providers:
built-in apps, extension-backed apps, PWAs (progressive web apps), ARC++
......
......@@ -190,7 +190,6 @@ js2gtest("browser_tests_js_mojo_lite_webui") {
test_type = "mojo_lite_webui"
sources = [
"app_management/app_management_browsertest.js",
"bluetooth_internals_browsertest.js",
"downloads/downloads_browsertest.js",
"engagement/site_engagement_browsertest.js",
......
// Copyright 2018 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.
/**
* @fileoverview Test suite for the App Management page.
*/
GEN_INCLUDE(['//chrome/test/data/webui/polymer_browser_test_base.js']);
GEN('#include "chrome/common/chrome_features.h"');
function AppManagementBrowserTest() {}
AppManagementBrowserTest.prototype = {
__proto__: PolymerTest.prototype,
browsePreload: 'chrome://app-management',
extraLibraries: [
...PolymerTest.prototype.extraLibraries,
'../test_util.js',
'../test_store.js',
'test_util.js',
'test_store.js',
],
featureList: {enabled: ['features::kAppManagement']},
/** override */
runAccessibilityChecks: true,
};
function AppManagementAppTest() {}
AppManagementAppTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'app_test.js',
]),
};
TEST_F('AppManagementAppTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementDomSwitchTest() {}
AppManagementDomSwitchTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'dom_switch_test.js',
]),
};
TEST_F('AppManagementDomSwitchTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementMainViewTest() {}
AppManagementMainViewTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'main_view_test.js',
]),
};
TEST_F('AppManagementMainViewTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementMetadataViewTest() {}
AppManagementMetadataViewTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'metadata_view_test.js',
]),
};
TEST_F('AppManagementMetadataViewTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementReducersTest() {}
AppManagementReducersTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'reducers_test.js',
]),
};
TEST_F('AppManagementReducersTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementRouterTest() {}
AppManagementRouterTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'router_test.js',
]),
};
TEST_F('AppManagementRouterTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementPwaPermissionViewTest() {}
AppManagementPwaPermissionViewTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'pwa_permission_view_test.js',
]),
};
TEST_F('AppManagementPwaPermissionViewTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementArcPermissionViewTest() {}
AppManagementArcPermissionViewTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'arc_permission_view_test.js',
]),
};
TEST_F('AppManagementArcPermissionViewTest', 'DISABLED_All', function() {
mocha.run();
});
function AppManagementManagedAppsTest() {}
AppManagementManagedAppsTest.prototype = {
__proto__: AppManagementBrowserTest.prototype,
extraLibraries: AppManagementBrowserTest.prototype.extraLibraries.concat([
'managed_apps_test.js',
]),
};
TEST_F('AppManagementManagedAppsTest', 'DISABLED_All', function() {
mocha.run();
});
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