Commit 9cebe159 authored by manuk's avatar manuk Committed by Commit Bot

[omnibox chrome:omnibox] Display answer image urls.

Currently, answer images are displayed as image elements whose src attribute
is set to a data url; the user has no way of obtaining the original
image url. This CL adds an anchor element displaying the image src to the
'Contents & Description & Answer' column.

Bug: 891303
Change-Id: I3ba68f58a95557554bee67d5088b10eec8b3bb29
Reviewed-on: https://chromium-review.googlesource.com/c/1430682Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625305}
parent f4b7e666
...@@ -638,7 +638,7 @@ cr.define('omnibox_output', function() { ...@@ -638,7 +638,7 @@ cr.define('omnibox_output', function() {
/** @type {!Element} */ /** @type {!Element} */
this.image_ = document.createElement('img'); this.image_ = document.createElement('img');
this.image_.classList.add('pair-item', 'image'); this.image_.classList.add('pair-item');
this.container_.appendChild(this.image_); this.container_.appendChild(this.image_);
/** @type {!Element} */ /** @type {!Element} */
...@@ -655,6 +655,11 @@ cr.define('omnibox_output', function() { ...@@ -655,6 +655,11 @@ cr.define('omnibox_output', function() {
this.answer_ = document.createElement('div'); this.answer_ = document.createElement('div');
this.answer_.classList.add('pair-item', 'answer'); this.answer_.classList.add('pair-item', 'answer');
this.container_.appendChild(this.answer_); this.container_.appendChild(this.answer_);
/** @type {!Element} */
this.imageUrl_ = document.createElement('a');
this.imageUrl_.classList.add('pair-item', 'image-url');
this.container_.appendChild(this.imageUrl_);
} }
/** @param {string} imageData */ /** @param {string} imageData */
...@@ -667,6 +672,8 @@ cr.define('omnibox_output', function() { ...@@ -667,6 +672,8 @@ cr.define('omnibox_output', function() {
this.contents_.textContent = this.values_[1]; this.contents_.textContent = this.values_[1];
this.description_.textContent = this.values_[2]; this.description_.textContent = this.values_[2];
this.answer_.textContent = this.values_[3]; this.answer_.textContent = this.values_[3];
this.imageUrl_.textContent = this.values_[0];
this.imageUrl_.href = this.values_[0];
} }
/** @override @return {string} */ /** @override @return {string} */
......
...@@ -115,6 +115,10 @@ th { ...@@ -115,6 +115,10 @@ th {
color: blue; color: blue;
} }
.header-contents-and-description .header-container :nth-child(3) {
color: orange;
}
.header-fill-and-inline .header-container :nth-child(2) { .header-fill-and-inline .header-container :nth-child(2) {
border: 1px solid; border: 1px solid;
} }
...@@ -157,6 +161,10 @@ th { ...@@ -157,6 +161,10 @@ th {
color: orange; color: orange;
} }
.cell-contents-and-description .pair-item.image-url {
font-size: .5rem;
}
.cell-fill-and-inline .pair-container { .cell-fill-and-inline .pair-container {
margin-inline-end: -1px; margin-inline-end: -1px;
} }
......
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