Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Issue 12418: Implement History as HTML and add/change a bunch of stuff to make it easier t... (Closed)

Created:
12 years, 1 month ago by Glen Murphy
Modified:
9 years, 5 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Implement History as HTML and add/change a bunch of stuff to make it easier to add HTML UIs in future. This CL does the following: * Adds the DOMUIContents TabContentsType. * Adds a DOMUI base class for HTML UIs. * Adds HistoryUI and its HTML/JS. * Changes 'chrome-resource://' to 'chrome://' globally (this is the bulk of the edited files) so we don't the situation where the display URL differs from the actual URL. This may have security implications that I'm not aware of, and someone should double-verify that there are no unpleasant side-effects of this change. Future work: * Remove the New Tab and Debugger TabContentTypes and make those classes use DOMUI instead. * Add history deletion (better than day-range deletion). * Once we're happy with the HTML UI, remove HistoryView/Model/TabUI and change all the history access points to point to chrome://history/ * Merge DOMUIContents with WebContents.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1847 lines, -225 lines) Patch
M chrome/app/generated_resources.grd View 2 3 4 5 6 1 chunk +46 lines, -15 lines 0 comments Download
M chrome/browser/browser.vcproj View 1 2 3 4 5 6 2 chunks +24 lines, -0 lines 0 comments Download
M chrome/browser/browser_about_handler.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browser_main.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browser_resources.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/browser_resources.rc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/browser_url_handler.cc View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/browsing_instance.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/debugger/debugger_contents.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/debugger/debugger_view.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/dom_ui/chrome_url_data_manager.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/dom_ui/chrome_url_data_manager.cc View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
A chrome/browser/dom_ui/dom_ui.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +86 lines, -0 lines 0 comments Download
A chrome/browser/dom_ui/dom_ui.cc View 1 2 3 4 5 6 1 chunk +124 lines, -0 lines 0 comments Download
A chrome/browser/dom_ui/dom_ui_contents.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +123 lines, -0 lines 0 comments Download
A chrome/browser/dom_ui/dom_ui_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +207 lines, -0 lines 0 comments Download
A chrome/browser/dom_ui/history_ui.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +83 lines, -0 lines 0 comments Download
A chrome/browser/dom_ui/history_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +303 lines, -0 lines 0 comments Download
M chrome/browser/dom_ui/new_tab_ui.h View 1 2 3 4 5 6 2 chunks +3 lines, -68 lines 0 comments Download
M chrome/browser/dom_ui/new_tab_ui.cc View 1 2 3 4 5 6 4 chunks +2 lines, -102 lines 0 comments Download
M chrome/browser/history/history.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/native_ui_contents.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/render_view_context_menu_controller.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_security_policy.cc View 1 2 3 4 5 6 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/renderer_security_policy_unittest.cc View 1 2 3 4 5 6 4 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/resources/browser_resources.vcproj View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/browser/resources/history.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +790 lines, -0 lines 0 comments Download
M chrome/browser/resources/new_tab.html View 1 2 3 4 5 6 7 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/site_instance.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents_factory.cc View 1 2 3 4 5 6 3 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents_type.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/renderer_glue.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M webkit/port/bindings/v8/v8_proxy.cpp View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
Glen Murphy
No rush on this review, sorry for the gigantifulness. Tim (sorry, Evan is on vacation), ...
12 years ago (2008-11-25 23:10:21 UTC) #1
tim (not reviewing)
first pass of comments, I'm still reviewing/thinking about the dom_ui stuff more closely. nothing major ...
12 years ago (2008-12-01 20:45:04 UTC) #2
Glen Murphy
These should be addressed, thanks a bunch for dealing with it. In the course of ...
12 years ago (2008-12-03 01:29:19 UTC) #3
tim (not reviewing)
http://codereview.chromium.org/12418/diff/674/707 File chrome/browser/dom_ui/dom_ui_contents.cc (right): http://codereview.chromium.org/12418/diff/674/707#newcode170 Line 170: current_ui_ = NULL; I don't see any call ...
12 years ago (2008-12-03 01:40:44 UTC) #4
Glen Murphy
Haha, when in doubt, assume I'm dimmer than two Das Keyboards. Deletes and DOMUIContents destructor ...
12 years ago (2008-12-03 01:55:14 UTC) #5
ojan
Non-JS code looks good. One high-level comment about the JS before I do a detailed ...
12 years ago (2008-12-03 02:30:27 UTC) #6
tim (not reviewing)
just a couple more things, lookin' good http://codereview.chromium.org/12418/diff/513/543 File chrome/browser/dom_ui/dom_ui.h (right): http://codereview.chromium.org/12418/diff/513/543#newcode9 Line 9: nit ...
12 years ago (2008-12-03 19:06:29 UTC) #7
Glen Murphy
Tim, the below should be done. I made NavigateToPendingEntry return false on a NULL current_ui_, ...
12 years ago (2008-12-03 21:58:26 UTC) #8
tim (not reviewing)
dom_ui/.* LGTM cap'n http://codereview.chromium.org/12418/diff/749/581 File chrome/browser/dom_ui/dom_ui.h (right): http://codereview.chromium.org/12418/diff/749/581#newcode21 Line 21: virtual void Init() = 0; ...
12 years ago (2008-12-03 22:21:12 UTC) #9
ojan
Lots of nits. A few possible bugs... http://codereview.chromium.org/12418/diff/749/578 File chrome/browser/resources/history.html (right): http://codereview.chromium.org/12418/diff/749/578#newcode20 Line 20: // ...
12 years ago (2008-12-04 02:06:57 UTC) #10
Aaron Boodman
http://codereview.chromium.org/12418/diff/749/578 File chrome/browser/resources/history.html (right): http://codereview.chromium.org/12418/diff/749/578#newcode154 Line 154: return str.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1"); On 2008/12/04 02:06:57, ojan wrote: ...
12 years ago (2008-12-04 04:16:33 UTC) #11
Glen Murphy
12 years ago (2008-12-04 17:51:35 UTC) #12
Chrome ate my original reply. Changes are in, and here's what I remember from my
response:

> http://codereview.chromium.org/12418/diff/749/578#newcode68
> Line 68: this.continued = continued;
> Aren't pretty much all of these properties private?

No, they're used by the result displayer to figure out gaps and date layouts.

> http://codereview.chromium.org/12418/diff/749/578#newcode205
> Line 205: this.requestedPage_ = opt_page ? opt_page : 0;
> How about adding a clearModel_ method that does 200-205 and is used here and
in
> the constructor? The code duplicated messes with my OCD.

Done, but I don't like putting member variable declarations so far away from the
constructor.

> http://codereview.chromium.org/12418/diff/749/578#newcode287
> Line 287: if (start >= this.getSize())
> What's the case where this would be true?

View can request any range it wants.

> http://codereview.chromium.org/12418/diff/749/578#newcode348
> Line 348: return ((page + 1) * RESULTS_PER_PAGE < this.getSize());
> return this.haveDataForPage_(page + 1);

There was a bug here - it's possible to fill a page without having data for the
next page. Changed a <=

> http://codereview.chromium.org/12418/diff/749/578#newcode440
> Line 440: } else if (lastTime - thisTime > 5 * 60 * 1000) {
> Readability nit: Make a global variable FIVE_MINUTES? Or,
> HistoryView.FIVE_MINUTES?

Changed to a global BROWSING_GAP_TIME.

> http://codereview.chromium.org/12418/diff/749/578#newcode487
> Line 487: return ['<a href="#" ',
> You don't need the # right? Just href="" should do since you are cancelling
the
> onclick. Keeps the status bar from showing a hash.
> 
> That said, right now we'll show the URL of the current page. Can you put a
TODO
> to make the status bar show something reasonable?

Changed to use a real URL, though it still SetPage+returns false onclick so that
we don't have to way for the state poller to catch the change.

> http://codereview.chromium.org/12418/diff/749/578#newcode511
> Line 511: if (this.checker_) {
> When would this ever be set?

If state is initialized multiple times (which should be a DCHECK or equivalent,
but I'm letting it continue silently for now).


> http://codereview.chromium.org/12418/diff/749/578#newcode544
> Line 544: if (pair.length >= 1) {
> Is this if-statement needed? When would this ever be false?

Whups. Changed to > 1 (for the ?p&q=1 case)

> http://codereview.chromium.org/12418/diff/749/578#newcode634
> Line 634: .main #results-summary {
> drop the ".main". it doesn't help disambiguate, right?
> 
> http://codereview.chromium.org/12418/diff/749/578#newcode642
> Line 642: .main #results-display {
> drop the ".main". it doesn't help disambiguate, right?
> 
> http://codereview.chromium.org/12418/diff/749/578#newcode690
> Line 690: .main #results-pagination {
> drop the ".main". it doesn't help disambiguate, right?

Changed, but aren't we now polluting the global CSS namespace? I die :p

> Even better, register the onclick handler and onsubmit handler below in the
load
> method.

For later, when HistoryView is more.

Powered by Google App Engine
This is Rietveld 408576698