Skip to content

Commit

Permalink
pdf: Add Ink resources
Browse files Browse the repository at this point in the history
These are the resources required to load the Ink component
compiled to Web Assembly. This will be used by PDF's
annotation feature, initially on Chrome OS.

Bug: 902646
Change-Id: I0eca3c71f3a4fd9f991a85da7f9188e7a8d3bc28
Reviewed-on: https://chromium-review.googlesource.com/c/1395860
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dstockwell <dstockwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621105}
  • Loading branch information
dstockwell authored and Commit Bot committed Jan 9, 2019
1 parent fb6d897 commit 000c2fd
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ group("extra_resources") {
"//chrome/browser/resources/chromeos/chromevox",
"//chrome/browser/resources/chromeos/select_to_speak:build",
"//chrome/browser/resources/chromeos/switch_access:build",
"//third_party/ink:ink_resources",
]
}

Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include_rules = [
"+extensions/strings/grit/extensions_strings.h",
"+services/network/public/mojom",
"+services/network/session_cleanup_cookie_store.h",
"+third_party/ink/grit",
"+ui/base",

# For access to testing command line switches.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "chrome/grit/theme_resources.h"

#if defined(OS_CHROMEOS)
#include "third_party/ink/grit/ink_resources.h"
#include "ui/file_manager/file_manager_resource_util.h"
#include "ui/file_manager/grit/file_manager_resources.h"
#include "ui/keyboard/resources/keyboard_resource_util.h"
Expand All @@ -35,6 +36,10 @@ ChromeComponentExtensionResourceManager() {
#if defined(OS_CHROMEOS)
{"chrome_app/chrome_app_icon_32.png", IDR_CHROME_APP_ICON_32},
{"chrome_app/chrome_app_icon_192.png", IDR_CHROME_APP_ICON_192},
{"pdf/ink/ink_lib_binary.js", IDR_INK_LIB_BINARY_JS},
{"pdf/ink/glcore_base.wasm", IDR_INK_GLCORE_BASE_WASM},
{"pdf/ink/glcore_wasm_bootstrap_compiled.js",
IDR_INK_GLCORE_WASM_BOOTSTRAP_COMPILED_JS},
#endif
};

Expand Down
2 changes: 2 additions & 0 deletions chrome/chrome_paks.gni
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,14 @@ template("chrome_extra_paks") {
"$root_gen_dir/ash/public/cpp/resources/ash_public_unscaled_resources.pak",
"$root_gen_dir/chrome/multidevice_setup_resources.pak",
"$root_gen_dir/chromeos/chromeos_resources.pak",
"$root_gen_dir/third_party/ink/ink_resources.pak",
"$root_gen_dir/ui/file_manager/file_manager_resources.pak",
]
deps += [
"//ash/public/cpp/resources:ash_public_unscaled_resources",
"//chrome/browser/resources/chromeos:multidevice_setup_resources",
"//chromeos/resources",
"//third_party/ink:ink_resources",
"//ui/file_manager:resources",
]
}
Expand Down
18 changes: 18 additions & 0 deletions third_party/ink/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019 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.

import("//tools/grit/grit_rule.gni")

if (is_chromeos) {
grit("ink_resources") {
source = "ink_resources.grd"

outputs = [
"grit/ink_resources.h",
"grit/ink_resources_map.cc",
"grit/ink_resources_map.h",
"ink_resources.pak",
]
}
}
20 changes: 20 additions & 0 deletions third_party/ink/ink_resources.grd
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/ink_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/ink_resources_map.cc" type="resource_file_map_source" />
<output filename="grit/ink_resources_map.h" type="resource_map_header" />
<output filename="ink_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<if expr="chromeos">
<include name="IDR_INK_LIB_BINARY_JS" file="build/ink_lib_binary.js" type="BINDATA" />
<include name="IDR_INK_GLCORE_BASE_WASM" file="build/wasm/glcore_base.wasm" type="BINDATA" />
<include name="IDR_INK_GLCORE_WASM_BOOTSTRAP_COMPILED_JS" file="build/wasm/glcore_wasm_bootstrap_compiled.js" type="BINDATA" />
</if>
</includes>
</release>
</grit>
6 changes: 4 additions & 2 deletions tools/gritsettings/resource_ids
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,11 @@
"includes": [25600],
"structures": [25700],
},

"third_party/ink/ink_resources.grd": {
"includes": [25900],
},
"third_party/libaddressinput/chromium/address_input_strings.grd": {
"messages": [25900],
"messages": [25910],
},

"ui/base/test/ui_base_test_resources.grd": {
Expand Down

0 comments on commit 000c2fd

Please sign in to comment.