|
downloads: break downloads.js into more classes/files.
chrome://downloads' code has gotten less flexible than we'd like over
the years and needs a little TLC.
This CL heavily refactors chrome://downloads code by ripping apart
downloads.js into:
downloads.{
Item: a light data wrapper that has-an ItemView
ItemView: responsible for beautiful downloads
Manager: owns and manages all the items
}
as well as moving large portions of programmatic DOM creation (i.e. tons
of document.createElement() calls) into an HTML template that's cloned.
The JS refactor loosens the coupling between various layers, more
clearly show responsibilities, and makes the code easier to understand,
test, and maintain (in theory).
The new way C++ => JS communication works is:
- if an item will be hidden or shown (e.g. remove, undo, new)
- C++ sends a whole new list to the JS
- the JS is now much smarter about re-using DOM nodes
- this preserves focus and has better performance
- if an item is simply updated (e.g. downloading in progress)
- C++ sends an update to that specific item
R=asanka@chromium.org
BUG= 446412
Committed: https://crrev.com/85c004102bdcf0e5d741559b2235fdcb9d4aaa19
Cr-Commit-Position: refs/heads/master@{#320204}
Total comments: 3
Total comments: 41
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1044 lines, -1159 lines) |
Patch |
|
M |
chrome/app/generated_resources.grd
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/browser_resources.grd
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_item_model.h
|
View
|
1
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_item_model.cc
|
View
|
1
|
3 chunks |
+15 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/resources/downloads/OWNERS
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/resources/downloads/compiled_resources.gyp
|
View
|
1
|
2 chunks |
+8 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/resources/downloads/downloads.css
|
View
|
1
2
3
4
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/resources/downloads/downloads.html
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+49 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/resources/downloads/downloads.js
|
View
|
1
|
1 chunk |
+0 lines, -1078 lines |
0 comments
|
Download
|
|
A |
chrome/browser/resources/downloads/externs.js
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+37 lines, -0 lines |
0 comments
|
Download
|
|
A |
chrome/browser/resources/downloads/focus_row.js
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+100 lines, -0 lines |
0 comments
|
Download
|
|
A |
chrome/browser/resources/downloads/item.js
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+58 lines, -0 lines |
0 comments
|
Download
|
|
A |
chrome/browser/resources/downloads/item_view.js
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+428 lines, -0 lines |
0 comments
|
Download
|
|
A |
chrome/browser/resources/downloads/manager.js
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+211 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/downloads_dom_handler.h
|
View
|
1
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/downloads_dom_handler.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
13 chunks |
+72 lines, -44 lines |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc
|
View
|
1
2
|
6 chunks |
+19 lines, -13 lines |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/downloads_ui.cc
|
View
|
1
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/downloads_ui_browsertest.js
|
View
|
1
2
|
6 chunks |
+11 lines, -5 lines |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/downloads_ui_browsertest_base.js
|
View
|
1
2
|
4 chunks |
+12 lines, -8 lines |
0 comments
|
Download
|
Total messages: 37 (14 generated)
|