Skip to content

Commit

Permalink
[vr] resources should be included if enable_vr, not is_android
Browse files Browse the repository at this point in the history
Previously, vr_shell_resources.grdp contained a condition that it be
included if enable_vr, but in browser_resources.grd we only included
this part if is_android. This allows vr_common_unittests to build on
linux when enable_vr is true.

We will eventually want to, for tests, use generic assets for the
controller (see crbug.com/743687), but this lets us test on linux
in the interim.

This change also relocates our resources to a more appropriate
location.

Bug: None
Change-Id: Ic17545487555595a867913fa58b74e559b26391d
Reviewed-on: https://chromium-review.googlesource.com/572943
Commit-Queue: Ian Vollick <vollick@chromium.org>
Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487190}
  • Loading branch information
Ian Vollick authored and Commit Bot committed Jul 17, 2017
1 parent 179769c commit d8f0cfa
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 14 deletions.
1 change: 0 additions & 1 deletion chrome/browser/android/vr_shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static_library("vr_android") {
":vr_shell_jni_headers",
"//base",
"//cc",
"//chrome:resources",
"//chrome/browser/vr:vr_common",
"//components/rappor",
"//content/public/android:jni",
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/browser_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@
<include name="IDR_SNIPPETS_INTERNALS_HTML" file="resources\snippets_internals.html" allowexternalscript="true" compress="gzip" type="BINDATA" />
<include name="IDR_SNIPPETS_INTERNALS_CSS" file="resources\snippets_internals.css" compress="gzip" type="BINDATA" />
<include name="IDR_SNIPPETS_INTERNALS_JS" file="resources\snippets_internals.js" compress="gzip" type="BINDATA" />
<part file="vr_shell_resources.grdp" />
</if>
<include name="IDR_SUPERVISED_USER_INTERNALS_HTML" file="resources\supervised_user_internals.html" allowexternalscript="true" compress="gzip" type="BINDATA" />
<include name="IDR_SUPERVISED_USER_INTERNALS_CSS" file="resources\supervised_user_internals.css" compress="gzip" type="BINDATA" />
Expand Down
12 changes: 12 additions & 0 deletions chrome/browser/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,15 @@ if (enable_extensions) {
output_dir = "$root_gen_dir/chrome"
}
}

if (enable_vr) {
grit("vr_shell_resources") {
source = "vr_shell_resources.grd"
defines = chrome_grit_defines
outputs = [
"grit/vr_shell_resources.h",
"vr_shell_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}
}
19 changes: 19 additions & 0 deletions chrome/browser/resources/vr_shell_resources.grd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/vr_shell_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="vr_shell_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<!-- TODO(vollick): add conditionals for test-specific generic assets (see crbug.com/743687) -->
<include name="IDR_VR_SHELL_DDCONTROLLER_MODEL" file="vr_shell\ddcontroller.glb" type="BINDATA" />
<include name="IDR_VR_SHELL_DDCONTROLLER_IDLE_TEXTURE" file="vr_shell\tex\ddcontroller_idle.png" type="BINDATA" />
<include name="IDR_VR_SHELL_DDCONTROLLER_APP_PATCH" file="vr_shell\tex\ddcontroller_app.png" type="BINDATA" />
<include name="IDR_VR_SHELL_DDCONTROLLER_TOUCHPAD_PATCH" file="vr_shell\tex\ddcontroller_touchpad.png" type="BINDATA" />
<include name="IDR_VR_SHELL_DDCONTROLLER_SYSTEM_PATCH" file="vr_shell\tex\ddcontroller_system.png" type="BINDATA" />
</includes>
</release>
</grit>
1 change: 1 addition & 0 deletions chrome/browser/vr/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static_library("vr_common") {
"//cc/animation",
"//cc/paint",
"//chrome/app:generated_resources",
"//chrome/browser/resources:vr_shell_resources",
"//components/security_state/core",
"//components/strings",
"//components/toolbar",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/vr/vr_controller_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/vr/gltf_parser.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/vr_shell_resources.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkSurface.h"
Expand Down
10 changes: 0 additions & 10 deletions chrome/browser/vr_shell_resources.grdp

This file was deleted.

4 changes: 4 additions & 0 deletions chrome/chrome_paks.gni
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ template("chrome_extra_paks") {
"//extensions:extensions_resources",
]
}
if (enable_vr) {
sources += [ "$root_gen_dir/chrome/vr_shell_resources.pak" ]
deps += [ "//chrome/browser/resources:vr_shell_resources" ]
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion tools/gritsettings/resource_ids
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@
"chrome/browser/resources/translate_internals_resources.grd": {
"includes": [12620],
},
"chrome/browser/resources/webapks_ui_resources.grd": {
"chrome/browser/resources/vr_shell_resources.grd": {
"includes": [12630],
},
"chrome/browser/resources/webapks_ui_resources.grd": {
"includes": [12640],
},
# END chrome/browser section.

# START chrome/ miscellaneous section.
Expand Down

0 comments on commit d8f0cfa

Please sign in to comment.