Commit d56a1315 authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Bundle component strings in //ios/web_view.

Fixes this warning log:
[0411/153122.161864:WARNING:resource_bundle.cc(565)] locale resources are not loaded

Also shows "This plugin is not supported" when visiting websites with flash content.

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I33e7e65dcb8193a93f5208f847a39a20e8472987
Bug: 811603
Reviewed-on: https://chromium-review.googlesource.com/1024488Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553312}
parent 3bfd9686
......@@ -5,6 +5,7 @@
import("//build/buildflag_header.gni")
import("//build/config/ios/ios_sdk.gni")
import("//build/config/ios/rules.gni")
import("//build/config/locales.gni")
import("//components/cronet/native/include/headers.gni")
import("//components/grpc_support/include/headers.gni")
import("//ios/build/config.gni")
......@@ -224,6 +225,7 @@ ios_web_view_deps = [
"//components/signin/core/browser",
"//components/signin/ios/browser",
"//components/signin/ios/browser:active_state_manager",
"//components/strings:components_strings_grit",
"//components/sync",
"//components/translate/core/browser",
"//components/translate/core/common",
......@@ -362,6 +364,17 @@ js_compile_bundle("web_view_bundle") {
]
}
repack_locales("repack_locales") {
visibility = [ ":packed_resources" ]
source_patterns = [ "${root_gen_dir}/components/strings/components_strings_" ]
deps = [
"//components/strings:components_strings",
]
input_locales = ios_packed_locales
output_locales = ios_packed_locales_as_mac_outputs
}
repack("repack_resources") {
visibility = [ ":packed_resources" ]
deps = [
......@@ -378,6 +391,7 @@ repack("repack_resources") {
bundle_data("packed_resources") {
visibility = [ "//ios/web_view:*" ]
public_deps = [
":repack_locales",
":repack_resources",
]
sources = [
......
......@@ -14,6 +14,7 @@ include_rules = [
"+components/proxy_config",
"+components/signin/core",
"+components/signin/ios",
"+components/strings/grit",
"+components/sync",
"+components/translate/core",
"+components/translate/ios",
......
......@@ -28,6 +28,7 @@ class WebViewWebClient : public web::WebClient {
base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override;
NSString* GetDocumentStartScriptForMainFrame(
web::BrowserState* browser_state) const override;
base::string16 GetPluginNotSupportedText() const override;
private:
DISALLOW_COPY_AND_ASSIGN(WebViewWebClient);
......
......@@ -7,11 +7,13 @@
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/strings/sys_string_conversions.h"
#include "components/strings/grit/components_strings.h"
#include "ios/web/public/user_agent.h"
#include "ios/web_view/internal/web_view_browser_state.h"
#import "ios/web_view/internal/web_view_early_page_script_provider.h"
#import "ios/web_view/internal/web_view_web_main_parts.h"
#include "ios/web_view/public/cwv_web_view.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
......@@ -82,4 +84,8 @@ NSString* WebViewWebClient::GetDocumentStartScriptForMainFrame(
return [scripts componentsJoinedByString:@";"];
}
base::string16 WebViewWebClient::GetPluginNotSupportedText() const {
return l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED);
}
} // namespace ios_web_view
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