summaryrefslogtreecommitdiff
path: root/chromium/ui/base/webui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/base/webui
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/base/webui')
-rw-r--r--chromium/ui/base/webui/i18n_source_stream.h5
-rw-r--r--chromium/ui/base/webui/jstemplate_builder.cc2
-rw-r--r--chromium/ui/base/webui/jstemplate_builder.h23
-rw-r--r--chromium/ui/base/webui/web_ui_util.cc8
-rw-r--r--chromium/ui/base/webui/web_ui_util.h61
5 files changed, 46 insertions, 53 deletions
diff --git a/chromium/ui/base/webui/i18n_source_stream.h b/chromium/ui/base/webui/i18n_source_stream.h
index 994ac6ce4ba..bba7a13c27e 100644
--- a/chromium/ui/base/webui/i18n_source_stream.h
+++ b/chromium/ui/base/webui/i18n_source_stream.h
@@ -8,14 +8,15 @@
#include <memory>
#include <string>
+#include "base/component_export.h"
#include "base/macros.h"
#include "net/filter/filter_source_stream.h"
#include "ui/base/template_expressions.h"
-#include "ui/base/ui_base_export.h"
namespace ui {
-class UI_BASE_EXPORT I18nSourceStream : public net::FilterSourceStream {
+class COMPONENT_EXPORT(UI_BASE) I18nSourceStream
+ : public net::FilterSourceStream {
public:
~I18nSourceStream() override;
diff --git a/chromium/ui/base/webui/jstemplate_builder.cc b/chromium/ui/base/webui/jstemplate_builder.cc
index b2b2b142275..50c52507d00 100644
--- a/chromium/ui/base/webui/jstemplate_builder.cc
+++ b/chromium/ui/base/webui/jstemplate_builder.cc
@@ -123,7 +123,7 @@ void AppendJsonJS(const base::DictionaryValue* json,
// If the script is being imported as a module, import |loadTimeData| in
// order to allow assigning the localized strings to loadTimeData.data.
output->append("import {loadTimeData} from ");
- output->append("'chrome://resources/js/load_time_data.m.js';\n");
+ output->append("'//resources/js/load_time_data.m.js';\n");
}
std::string jstext;
diff --git a/chromium/ui/base/webui/jstemplate_builder.h b/chromium/ui/base/webui/jstemplate_builder.h
index 5b1c1170690..97a4a558a2d 100644
--- a/chromium/ui/base/webui/jstemplate_builder.h
+++ b/chromium/ui/base/webui/jstemplate_builder.h
@@ -15,8 +15,8 @@
#include <string>
+#include "base/component_export.h"
#include "base/strings/string_piece.h"
-#include "ui/base/ui_base_export.h"
namespace base {
class DictionaryValue;
@@ -27,22 +27,23 @@ namespace webui {
// A helper function that generates a string of HTML to be loaded. The
// string includes the HTML and the javascript code necessary to generate the
// full page with support for i18n Templates.
-UI_BASE_EXPORT std::string GetI18nTemplateHtml(
- const base::StringPiece& html_template,
- const base::DictionaryValue* json);
+COMPONENT_EXPORT(UI_BASE)
+std::string GetI18nTemplateHtml(const base::StringPiece& html_template,
+ const base::DictionaryValue* json);
// A helper function that generates a string of HTML to be loaded. The
// string includes the HTML and the javascript code necessary to generate the
// full page with support for both i18n Templates and JsTemplates.
-UI_BASE_EXPORT std::string GetTemplatesHtml(
- const base::StringPiece& html_template,
- const base::DictionaryValue* json,
- const base::StringPiece& template_id);
+COMPONENT_EXPORT(UI_BASE)
+std::string GetTemplatesHtml(const base::StringPiece& html_template,
+ const base::DictionaryValue* json,
+ const base::StringPiece& template_id);
// Assigns the given json data into |loadTimeData|, without a <script> tag.
-UI_BASE_EXPORT void AppendJsonJS(const base::DictionaryValue* json,
- std::string* output,
- bool from_js_module);
+COMPONENT_EXPORT(UI_BASE)
+void AppendJsonJS(const base::DictionaryValue* json,
+ std::string* output,
+ bool from_js_module);
} // namespace webui
diff --git a/chromium/ui/base/webui/web_ui_util.cc b/chromium/ui/base/webui/web_ui_util.cc
index 6b6ea2d9bb7..ffc30f61a7a 100644
--- a/chromium/ui/base/webui/web_ui_util.cc
+++ b/chromium/ui/base/webui/web_ui_util.cc
@@ -189,7 +189,6 @@ void ParsePathAndFrame(const GURL& url, std::string* path, int* frame_index) {
void SetLoadTimeDataDefaults(const std::string& app_locale,
base::DictionaryValue* localized_strings) {
- localized_strings->SetString("a11yenhanced", GetA11yEnhanced());
localized_strings->SetString("fontfamily", GetFontFamily());
localized_strings->SetString("fontsize", GetFontSize());
localized_strings->SetString("language", l10n_util::GetLanguage(app_locale));
@@ -198,7 +197,6 @@ void SetLoadTimeDataDefaults(const std::string& app_locale,
void SetLoadTimeDataDefaults(const std::string& app_locale,
ui::TemplateReplacements* replacements) {
- (*replacements)["a11yenhanced"] = GetA11yEnhanced();
(*replacements)["fontfamily"] = GetFontFamily();
(*replacements)["fontsize"] = GetFontSize();
(*replacements)["language"] = l10n_util::GetLanguage(app_locale);
@@ -225,12 +223,6 @@ void AppendWebUiCssTextDefaults(std::string* html) {
html->append("</style>");
}
-std::string GetA11yEnhanced() {
- return base::FeatureList::IsEnabled(features::kWebUIA11yEnhancements)
- ? "a11y-enhanced"
- : "";
-}
-
std::string GetFontFamily() {
std::string font_family = l10n_util::GetStringUTF8(IDS_WEB_FONT_FAMILY);
diff --git a/chromium/ui/base/webui/web_ui_util.h b/chromium/ui/base/webui/web_ui_util.h
index 77e20e282e8..1aa12627756 100644
--- a/chromium/ui/base/webui/web_ui_util.h
+++ b/chromium/ui/base/webui/web_ui_util.h
@@ -9,10 +9,10 @@
#include <string>
+#include "base/component_export.h"
#include "base/strings/string_piece.h"
#include "base/values.h"
#include "ui/base/template_expressions.h"
-#include "ui/base/ui_base_export.h"
#include "ui/base/window_open_disposition.h"
class GURL;
@@ -27,21 +27,22 @@ struct LocalizedString {
// Convenience routine to convert SkBitmap object to data url
// so that it can be used in WebUI.
-UI_BASE_EXPORT std::string GetBitmapDataUrl(const SkBitmap& bitmap);
+COMPONENT_EXPORT(UI_BASE) std::string GetBitmapDataUrl(const SkBitmap& bitmap);
// Convenience routine to convert an in-memory PNG to a data url for WebUI use.
-UI_BASE_EXPORT std::string GetPngDataUrl(const unsigned char* data,
- size_t size);
+COMPONENT_EXPORT(UI_BASE)
+std::string GetPngDataUrl(const unsigned char* data, size_t size);
// Extracts a disposition from click event arguments. |args| should contain
// an integer button and booleans alt key, ctrl key, meta key, and shift key
// (in that order), starting at |start_index|.
-UI_BASE_EXPORT WindowOpenDisposition
- GetDispositionFromClick(const base::ListValue* args, int start_index);
+COMPONENT_EXPORT(UI_BASE)
+WindowOpenDisposition GetDispositionFromClick(const base::ListValue* args,
+ int start_index);
// Parse a formatted scale factor string into float and sets to |scale_factor|.
-UI_BASE_EXPORT bool ParseScaleFactor(const base::StringPiece& identifier,
- float* scale_factor);
+COMPONENT_EXPORT(UI_BASE)
+bool ParseScaleFactor(const base::StringPiece& identifier, float* scale_factor);
// Parses a URL containing some path [{frame}]@{scale}x. If it contains a
// scale factor then it is returned and the associated part of the URL is
@@ -50,49 +51,47 @@ UI_BASE_EXPORT bool ParseScaleFactor(const base::StringPiece& identifier,
// is returned and the associated part of the URL is removed from the
// returned |path|, otherwise the default frame index is returned and |path|
// is left intact.
-UI_BASE_EXPORT void ParsePathAndImageSpec(const GURL& url,
- std::string* path,
- float* scale_factor,
- int* frame_index);
+COMPONENT_EXPORT(UI_BASE)
+void ParsePathAndImageSpec(const GURL& url,
+ std::string* path,
+ float* scale_factor,
+ int* frame_index);
// Parses a URL containing some path @{scale}x. If it does not contain a scale
// factor then the default scale factor is returned.
-UI_BASE_EXPORT void ParsePathAndScale(const GURL& url,
- std::string* path,
- float* scale_factor);
+COMPONENT_EXPORT(UI_BASE)
+void ParsePathAndScale(const GURL& url, std::string* path, float* scale_factor);
// Parses a URL containing some path [{frame}]. If it does not contain a frame
// index then the default frame index is returned.
-UI_BASE_EXPORT void ParsePathAndFrame(const GURL& url,
- std::string* path,
- int* frame_index);
+COMPONENT_EXPORT(UI_BASE)
+void ParsePathAndFrame(const GURL& url, std::string* path, int* frame_index);
// Helper function to set some default values (e.g., font family, size,
// language, and text direction) into the given dictionary. Requires an
// application locale (i.e. g_browser_process->GetApplicationLocale()).
-UI_BASE_EXPORT void SetLoadTimeDataDefaults(
- const std::string& app_locale,
- base::DictionaryValue* localized_strings);
-UI_BASE_EXPORT void SetLoadTimeDataDefaults(
- const std::string& app_locale,
- ui::TemplateReplacements* replacements);
+COMPONENT_EXPORT(UI_BASE)
+void SetLoadTimeDataDefaults(const std::string& app_locale,
+ base::DictionaryValue* localized_strings);
+COMPONENT_EXPORT(UI_BASE)
+void SetLoadTimeDataDefaults(const std::string& app_locale,
+ ui::TemplateReplacements* replacements);
// Get a CSS declaration for common text styles for all of Web UI.
-UI_BASE_EXPORT std::string GetWebUiCssTextDefaults();
+COMPONENT_EXPORT(UI_BASE) std::string GetWebUiCssTextDefaults();
// Get a CSS declaration for common text styles for Web UI using
// Material Design.
-UI_BASE_EXPORT std::string GetWebUiCssTextDefaultsMd();
+COMPONENT_EXPORT(UI_BASE) std::string GetWebUiCssTextDefaultsMd();
// Appends the CSS declaration returned by GetWebUiCssTextDefaults() as an
// inline stylesheet.
-UI_BASE_EXPORT void AppendWebUiCssTextDefaults(std::string* html);
+COMPONENT_EXPORT(UI_BASE) void AppendWebUiCssTextDefaults(std::string* html);
-UI_BASE_EXPORT std::string GetA11yEnhanced();
// Get some common font styles for all of WebUI.
-UI_BASE_EXPORT std::string GetFontFamily();
-UI_BASE_EXPORT std::string GetFontSize();
-UI_BASE_EXPORT std::string GetTextDirection();
+COMPONENT_EXPORT(UI_BASE) std::string GetFontFamily();
+COMPONENT_EXPORT(UI_BASE) std::string GetFontSize();
+COMPONENT_EXPORT(UI_BASE) std::string GetTextDirection();
} // namespace webui