Commit 73dee068 authored by rkc@chromium.org's avatar rkc@chromium.org

Set the attach file checkbox to checked when launched from an extension.

If we're launched from an extension with the filepath given, set the checkbox to checked.
This CL also fixes a bug which was preventing attach file from an extension from working.

R=dbeam@chromium.org
BUG=223160
TEST=Attach a file from the QO extension and confirm that everything works.

Review URL: https://codereview.chromium.org/13853008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194678 0039d316-1c4b-4281-b951-d872f2087c98
parent 47975e5d
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div id="attach-file-custom-container" class="input-text-container checkbox" <div id="attach-file-custom-container" class="input-text-container checkbox"
hidden> hidden>
<label> <label>
<input id="attach-file-custom-checkbox" type="checkbox"> <input id="attach-file-custom-checkbox" type="checkbox" checked>
<span i18n-content="attach-file-label"></span> <span i18n-content="attach-file-label"></span>
</label> </label>
<span id="attach-file-custom-name" ></span> <span id="attach-file-custom-name" ></span>
......
...@@ -305,7 +305,14 @@ function load() { ...@@ -305,7 +305,14 @@ function load() {
'filePath': '', 'filePath': '',
}; };
var query = window.location.search.substr(1).split('&'); var loc = window.location;
// Split the query string into an array of parameters.
var query = loc.search.substr(1).split('&');
// If we have a query in the hash.
if (loc.hash.indexOf('?') >= 0) {
// Remove the hash and split this query into parameters too.
query = query.concat(loc.hash.substr(loc.hash.indexOf('?') + 1).split('&'));
}
for (var i = 0; i < query.length; i++) { for (var i = 0; i < query.length; i++) {
// Decode and store each parameter value. // Decode and store each parameter value.
parameter = query[i].split('='); parameter = query[i].split('=');
......
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