Commit 7e453e2b authored by Yann Dago's avatar Yann Dago Committed by Commit Bot

Management webUI: Added favIcon

Bug: 933811
Change-Id: I0b8fc2409051e5b8c18b6a91cf5821b0b84b3862
Reviewed-on: https://chromium-review.googlesource.com/c/1486712Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Yann Dago <ydago@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635268}
parent f84fc347
......@@ -222,6 +222,7 @@
<structure type="chrome_scaled_image" name="IDR_SECONDARY_USER_SETTINGS" file="cros/secondary_user_settings.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_SETTINGS_FAVICON" file="common/favicon_settings.png" />
<structure type="chrome_scaled_image" name="IDR_MANAGEMENT_FAVICON" file="common/favicon_management.png" />
<structure type="chrome_scaled_image" name="IDR_SHOW_PASSWORD_HOVER" file="common/show_password_hover.png" />
<if expr="chromeos">
<structure type="chrome_scaled_image" name="IDR_SMB_ICON" file="cros/smb_icon.png" />
......
......@@ -125,11 +125,12 @@
#include "chrome/browser/ui/webui/webapks_ui.h"
#include "components/feed/feed_feature_list.h"
#else
#include "chrome/browser/ui/webui/devtools_ui.h"
#include "chrome/browser/ui/webui/inspect_ui.h"
#include "chrome/browser/ui/webui/bookmarks/bookmarks_ui.h"
#include "chrome/browser/ui/webui/devtools_ui.h"
#include "chrome/browser/ui/webui/downloads/downloads_ui.h"
#include "chrome/browser/ui/webui/history_ui.h"
#include "chrome/browser/ui/webui/inspect_ui.h"
#include "chrome/browser/ui/webui/management_ui.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/page_not_available_for_guest/page_not_available_for_guest_ui.h"
#include "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_ui.h"
......@@ -883,6 +884,9 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes(
if (page_url.host_piece() == chrome::kChromeUISettingsHost)
return settings_utils::GetFaviconResourceBytes(scale_factor);
if (page_url.host_piece() == chrome::kChromeUIManagementHost)
return ManagementUI::GetFaviconResourceBytes(scale_factor);
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (page_url.host_piece() == chrome::kChromeUIExtensionsHost ||
page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) {
......
......@@ -11,9 +11,11 @@
#include "chrome/browser/ui/webui/management_ui_handler.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "extensions/buildflags/buildflags.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
......@@ -99,6 +101,13 @@ content::WebUIDataSource* CreateManagementUIHtmlSource() {
} // namespace
// static
base::RefCountedMemory* ManagementUI::GetFaviconResourceBytes(
ui::ScaleFactor scale_factor) {
return ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
IDR_MANAGEMENT_FAVICON, scale_factor);
}
ManagementUI::ManagementUI(content::WebUI* web_ui) : WebUIController(web_ui) {
web_ui->AddMessageHandler(std::make_unique<ManagementUIHandler>());
content::WebUIDataSource* source = CreateManagementUIHtmlSource();
......
......@@ -7,6 +7,11 @@
#include "base/macros.h"
#include "content/public/browser/web_ui_controller.h"
#include "ui/base/resource/scale_factor.h"
namespace base {
class RefCountedMemory;
}
namespace content {
class WebUI;
......@@ -18,6 +23,9 @@ class ManagementUI : public content::WebUIController {
explicit ManagementUI(content::WebUI* web_ui);
~ManagementUI() override;
static base::RefCountedMemory* GetFaviconResourceBytes(
ui::ScaleFactor scale_factor);
private:
DISALLOW_COPY_AND_ASSIGN(ManagementUI);
};
......
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