-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Externalize HTML/JS changes to extensions item_list.html/js.
- Adds brave_extensions_resources.pak Fixes brave/brave-browser#3012
- Loading branch information
Showing
11 changed files
with
177 additions
and
11 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
29 changes: 29 additions & 0 deletions
29
browser/resources/md_extensions/brave_item_list_more_items.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,29 @@ | ||
<link rel="import" href="chrome://resources/html/polymer.html"> | ||
|
||
<link rel="import" href="chrome://resources/cr_elements/cr_container_shadow_behavior.html"> | ||
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> | ||
<link rel="import" href="chrome://resources/html/cr.html"> | ||
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> | ||
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-announcer/iron-a11y-announcer.html"> | ||
|
||
<dom-module id="extensions-brave-item-list-more-items"> | ||
<template> | ||
<style include="cr-shared-style"> | ||
.more-items-message { | ||
color: #6e6e6e; | ||
font-size: 123%; /* Should be 16px when 100% is 13px. */ | ||
font-weight: 500; | ||
margin-top: 32px; | ||
text-align: center; | ||
} | ||
</style> | ||
<div id="more-items" class="more-items-message" | ||
hidden$="[[!shouldShowMoreItemsMessage_( | ||
apps.length, extensions.length)]]"> | ||
<span> | ||
$i18nRaw{noExtensionsOrApps} | ||
</span> | ||
</div> | ||
</template> | ||
<script src="brave_item_list_more_items.js"></script> | ||
</dom-module> |
29 changes: 29 additions & 0 deletions
29
browser/resources/md_extensions/brave_item_list_more_items.js
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,29 @@ | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
cr.define('extensions', function() { | ||
'use strict'; | ||
|
||
const MoreItems = Polymer({ | ||
is: 'extensions-brave-item-list-more-items', | ||
|
||
properties: { | ||
/** @type {!Array<!chrome.developerPrivate.ExtensionInfo>} */ | ||
apps: Array, | ||
|
||
/** @type {!Array<!chrome.developerPrivate.ExtensionInfo>} */ | ||
extensions: Array, | ||
}, | ||
|
||
shouldShowMoreItemsMessage_: function() { | ||
if (!this.apps || !this.extensions) | ||
return; | ||
|
||
return this.apps.length !== 0 || this.extensions.length !== 0; | ||
}, | ||
}); | ||
|
||
return {MoreItems: MoreItems}; | ||
}); |
Empty file.
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 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false"> | ||
<outputs> | ||
<output filename="grit/brave_extensions_resources.h" type="rc_header"> | ||
<emit emit_type="prepend" /> | ||
</output> | ||
<output filename="grit/brave_extensions_resources_map.cc" type="resource_file_map_source" /> | ||
<output filename="grit/brave_extensions_resources_map.h" type="resource_map_header" /> | ||
<output filename="brave_extensions_resources.pak" type="data_package" /> | ||
</outputs> | ||
<release seq="1"> | ||
<structures> | ||
<structure name="IDR_EXTENSIONS_BRAVE_ITEM_LIST_MORE_ITEMS_JS" file="brave_item_list_more_items.js" type="chrome_html" preprocess="true" /> | ||
<structure name="IDR_EXTENSIONS_BRAVE_ITEM_LIST_MORE_ITEMS_HTML" file="brave_item_list_more_items.html" type="chrome_html" preprocess="true" allowexternalscript="true" /> | ||
</structures> | ||
<includes> | ||
<include name="IDR_EXTENSIONS_BRAVE_STAMP" file="brave_unpack.stamp" type="BINDATA" /> | ||
</includes> | ||
</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
20 changes: 11 additions & 9 deletions
20
patches/chrome-browser-resources-md_extensions-item_list.html.patch
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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
diff --git a/chrome/browser/resources/md_extensions/item_list.html b/chrome/browser/resources/md_extensions/item_list.html | ||
index 71766b65bc271a903e60f9c4838eb119406fb3e3..fa6dc6977f4d4f0c9493409226392678cc7e53b7 100644 | ||
index 71766b65bc271a903e60f9c4838eb119406fb3e3..c0635f2ef405e56b3f1ef1ce9910ec9bdf106bad 100644 | ||
--- a/chrome/browser/resources/md_extensions/item_list.html | ||
+++ b/chrome/browser/resources/md_extensions/item_list.html | ||
@@ -122,6 +122,13 @@ | ||
@@ -7,6 +7,7 @@ | ||
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> | ||
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-announcer/iron-a11y-announcer.html"> | ||
<link rel="import" href="item.html"> | ||
+<link rel="import" href="brave_item_list_more_items.html"> | ||
|
||
<dom-module id="extensions-item-list"> | ||
<template> | ||
@@ -122,6 +123,7 @@ | ||
</template> | ||
</div> | ||
</div> | ||
+ <div id="more-items" class="empty-list-message" style="margin-top: 32px;" | ||
+ hidden$="[[shouldShowEmptyItemsMessage_( | ||
+ apps.length, extensions.length)]]"> | ||
+ <span> | ||
+ $i18nRaw{noExtensionsOrApps} | ||
+ </span> | ||
+ </div> | ||
+ <extensions-brave-item-list-more-items apps="{{apps}}" extensions="{{extensions}}" /> | ||
</div> | ||
</div> | ||
</template> |
13 changes: 13 additions & 0 deletions
13
patches/chrome-browser-ui-webui-extensions-extensions_ui.cc.patch
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,13 @@ | ||
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc | ||
index e30570e55a7a6edd7153fae5d99f4aae28c00a34..d3164662ac2697026340876d87be1b3367e84af2 100644 | ||
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc | ||
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc | ||
@@ -338,6 +338,8 @@ content::WebUIDataSource* CreateMdExtensionsSource(Profile* profile, | ||
source->SetDefaultResource(IDR_MD_EXTENSIONS_EXTENSIONS_HTML); | ||
#endif | ||
|
||
+ BraveAddExtensionsResources(source); | ||
+ | ||
return source; | ||
} | ||
|