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

Issue 2804793002: Print Preview: Fix failure to save with long page title (Closed)

Created:
3 years, 8 months ago by rbpotter
Modified:
3 years, 8 months ago
Reviewers:
Lei Zhang, Nico, ananta
CC:
chromium-reviews, ananta
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Print Preview: Fix failure to save with long page title BUG=707538 Review-Url: https://codereview.chromium.org/2804793002 Cr-Commit-Position: refs/heads/master@{#466053} Committed: https://chromium.googlesource.com/chromium/src/+/e5be563564bd38f1f8355406a658ff93bc71027a

Patch Set 1 #

Total comments: 1

Patch Set 2 : Move length check to select file dialog #

Total comments: 8

Patch Set 3 : Remove path check #

Total comments: 4

Patch Set 4 : Fix extension issues #

Total comments: 6

Patch Set 5 : Move modifications to function #

Total comments: 11

Patch Set 6 : Address comments #

Total comments: 4

Patch Set 7 : Use beginning of extension #

Total comments: 4

Patch Set 8 : Use resize, simplify #

Total comments: 4

Patch Set 9 : Add test #

Total comments: 12

Patch Set 10 : Fix unit test #

Patch Set 11 : Add integration test #

Total comments: 31

Patch Set 12 : Address comments and fix test dcheck #

Total comments: 16

Patch Set 13 : Address comments #

Total comments: 2

Patch Set 14 : Remove unused line #

Unified diffs Side-by-side diffs Delta from patch set Stats (+341 lines, -11 lines) Patch
M chrome/browser/ui/webui/print_preview/print_preview_handler.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +12 lines, -10 lines 0 comments Download
A chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +177 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M ui/shell_dialogs/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M ui/shell_dialogs/select_file_dialog.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M ui/shell_dialogs/select_file_dialog.cc View 1 2 3 4 5 6 7 8 9 3 chunks +28 lines, -1 line 0 comments Download
A ui/shell_dialogs/select_file_dialog_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +117 lines, -0 lines 0 comments Download

Messages

Total messages: 90 (56 generated)
rbpotter
3 years, 8 months ago (2017-04-05 18:04:00 UTC) #3
Lei Zhang
This is probably ok, but I wonder if we should be doing this in SelectFileDialog::SelectFile() ...
3 years, 8 months ago (2017-04-05 20:06:07 UTC) #4
ananta
It would be great if we could confirm that the problem exists only on Windows? ...
3 years, 8 months ago (2017-04-05 21:23:15 UTC) #6
rbpotter
On 2017/04/05 21:23:15, ananta wrote: > It would be great if we could confirm that ...
3 years, 8 months ago (2017-04-05 21:32:06 UTC) #7
rbpotter
On 2017/04/05 21:32:06, rbpotter wrote: > On 2017/04/05 21:23:15, ananta wrote: > > It would ...
3 years, 8 months ago (2017-04-06 00:35:26 UTC) #8
Lei Zhang
https://codereview.chromium.org/2804793002/diff/20001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/20001/ui/shell_dialogs/select_file_dialog.cc#newcode89 ui/shell_dialogs/select_file_dialog.cc:89: // Shorten filename if necessary. Do this right before ...
3 years, 8 months ago (2017-04-06 00:47:05 UTC) #9
rbpotter
https://codereview.chromium.org/2804793002/diff/20001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/20001/ui/shell_dialogs/select_file_dialog.cc#newcode89 ui/shell_dialogs/select_file_dialog.cc:89: // Shorten filename if necessary. On 2017/04/06 00:47:05, Lei ...
3 years, 8 months ago (2017-04-12 17:25:19 UTC) #10
Lei Zhang
https://codereview.chromium.org/2804793002/diff/40001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/40001/ui/shell_dialogs/select_file_dialog.cc#newcode105 ui/shell_dialogs/select_file_dialog.cc:105: size_t max_name_length = 255; const size_t kMaxNameLength ? https://codereview.chromium.org/2804793002/diff/40001/ui/shell_dialogs/select_file_dialog.cc#newcode107 ...
3 years, 8 months ago (2017-04-12 19:10:25 UTC) #11
rbpotter
https://codereview.chromium.org/2804793002/diff/40001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/40001/ui/shell_dialogs/select_file_dialog.cc#newcode105 ui/shell_dialogs/select_file_dialog.cc:105: size_t max_name_length = 255; On 2017/04/12 19:10:25, Lei Zhang ...
3 years, 8 months ago (2017-04-13 00:25:03 UTC) #15
Lei Zhang
https://codereview.chromium.org/2804793002/diff/60001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/60001/ui/shell_dialogs/select_file_dialog.cc#newcode102 ui/shell_dialogs/select_file_dialog.cc:102: // Shorten filename if necessary. This is getting long-ish. ...
3 years, 8 months ago (2017-04-13 01:34:51 UTC) #19
rbpotter
https://codereview.chromium.org/2804793002/diff/60001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/60001/ui/shell_dialogs/select_file_dialog.cc#newcode102 ui/shell_dialogs/select_file_dialog.cc:102: // Shorten filename if necessary. On 2017/04/13 01:34:51, Lei ...
3 years, 8 months ago (2017-04-13 19:21:02 UTC) #22
Lei Zhang
https://codereview.chromium.org/2804793002/diff/80001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/80001/ui/shell_dialogs/select_file_dialog.cc#newcode78 ui/shell_dialogs/select_file_dialog.cc:78: namespace { There's already one up on line 20. ...
3 years, 8 months ago (2017-04-13 19:33:53 UTC) #23
rbpotter
https://codereview.chromium.org/2804793002/diff/80001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/80001/ui/shell_dialogs/select_file_dialog.cc#newcode78 ui/shell_dialogs/select_file_dialog.cc:78: namespace { On 2017/04/13 19:33:53, Lei Zhang wrote: > ...
3 years, 8 months ago (2017-04-13 20:53:56 UTC) #27
Lei Zhang
https://codereview.chromium.org/2804793002/diff/80001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/80001/ui/shell_dialogs/select_file_dialog.cc#newcode89 ui/shell_dialogs/select_file_dialog.cc:89: if (filename.value().length() < kMaxNameLength) { On 2017/04/13 20:53:56, rbpotter ...
3 years, 8 months ago (2017-04-13 21:13:44 UTC) #29
rbpotter
https://codereview.chromium.org/2804793002/diff/100001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/100001/ui/shell_dialogs/select_file_dialog.cc#newcode45 ui/shell_dialogs/select_file_dialog.cc:45: base::FilePath::StringType new_extension; On 2017/04/13 21:13:44, Lei Zhang wrote: > ...
3 years, 8 months ago (2017-04-13 21:48:38 UTC) #31
Lei Zhang
lgtm https://codereview.chromium.org/2804793002/diff/120001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/120001/ui/shell_dialogs/select_file_dialog.cc#newcode42 ui/shell_dialogs/select_file_dialog.cc:42: if (extension.length() >= max_extension_length) { Just > now? ...
3 years, 8 months ago (2017-04-13 21:53:10 UTC) #33
rbpotter
https://codereview.chromium.org/2804793002/diff/120001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/120001/ui/shell_dialogs/select_file_dialog.cc#newcode42 ui/shell_dialogs/select_file_dialog.cc:42: if (extension.length() >= max_extension_length) { On 2017/04/13 21:53:09, Lei ...
3 years, 8 months ago (2017-04-13 23:02:11 UTC) #35
rbpotter
On 2017/04/13 23:02:11, rbpotter wrote: > https://codereview.chromium.org/2804793002/diff/120001/ui/shell_dialogs/select_file_dialog.cc > File ui/shell_dialogs/select_file_dialog.cc (right): > > https://codereview.chromium.org/2804793002/diff/120001/ui/shell_dialogs/select_file_dialog.cc#newcode42 > ...
3 years, 8 months ago (2017-04-13 23:20:18 UTC) #38
Nico
Do we have some integration test for this? https://codereview.chromium.org/2804793002/diff/140001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/140001/ui/shell_dialogs/select_file_dialog.cc#newcode26 ui/shell_dialogs/select_file_dialog.cc:26: // ...
3 years, 8 months ago (2017-04-14 14:03:34 UTC) #41
rbpotter
Added a unit test. https://codereview.chromium.org/2804793002/diff/140001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/140001/ui/shell_dialogs/select_file_dialog.cc#newcode26 ui/shell_dialogs/select_file_dialog.cc:26: // is the limit on ...
3 years, 8 months ago (2017-04-14 22:04:39 UTC) #49
Lei Zhang
https://codereview.chromium.org/2804793002/diff/220001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/220001/ui/shell_dialogs/select_file_dialog.cc#newcode78 ui/shell_dialogs/select_file_dialog.cc:78: // Returns a file path with a base name ...
3 years, 8 months ago (2017-04-15 22:19:34 UTC) #52
rbpotter
https://codereview.chromium.org/2804793002/diff/220001/ui/shell_dialogs/select_file_dialog.cc File ui/shell_dialogs/select_file_dialog.cc (right): https://codereview.chromium.org/2804793002/diff/220001/ui/shell_dialogs/select_file_dialog.cc#newcode78 ui/shell_dialogs/select_file_dialog.cc:78: // Returns a file path with a base name ...
3 years, 8 months ago (2017-04-17 17:48:49 UTC) #56
Nico
As far as I can tell, this tests the new function (great!) but not the ...
3 years, 8 months ago (2017-04-17 18:58:26 UTC) #57
rbpotter
On 2017/04/17 18:58:26, Nico wrote: > As far as I can tell, this tests the ...
3 years, 8 months ago (2017-04-19 19:17:32 UTC) #62
Nico
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.win%2Fwin_chromium_x64_rel_ng%2F408834%2F%2B%2Frecipes%2Fsteps%2Funit_tests__with_patch_%2F0%2Flogs%2FPrintPreviewHandlerTest.TestSaveAsPdfLongFileName%2F0 [ RUN ] PrintPreviewHandlerTest.TestSaveAsPdfLongFileName [4568:520:0419/123028.049:6939018:FATAL:run_loop.cc(49)] Check failed: thread_checker_.CalledOnValidThread(). :-/
3 years, 8 months ago (2017-04-19 20:00:03 UTC) #65
Lei Zhang
https://codereview.chromium.org/2804793002/diff/280001/chrome/browser/ui/webui/print_preview/print_preview_handler.h File chrome/browser/ui/webui/print_preview/print_preview_handler.h (right): https://codereview.chromium.org/2804793002/diff/280001/chrome/browser/ui/webui/print_preview/print_preview_handler.h#newcode117 chrome/browser/ui/webui/print_preview/print_preview_handler.h:117: // The underlying dialog object. Protecteed to expose to ...
3 years, 8 months ago (2017-04-19 21:14:08 UTC) #66
rbpotter
https://codereview.chromium.org/2804793002/diff/280001/chrome/browser/ui/webui/print_preview/print_preview_handler.h File chrome/browser/ui/webui/print_preview/print_preview_handler.h (right): https://codereview.chromium.org/2804793002/diff/280001/chrome/browser/ui/webui/print_preview/print_preview_handler.h#newcode117 chrome/browser/ui/webui/print_preview/print_preview_handler.h:117: // The underlying dialog object. Protecteed to expose to ...
3 years, 8 months ago (2017-04-19 23:30:13 UTC) #69
Lei Zhang
https://codereview.chromium.org/2804793002/diff/280001/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc File chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc (right): https://codereview.chromium.org/2804793002/diff/280001/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc#newcode127 chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc:127: // Create a new tab On 2017/04/19 23:30:13, rbpotter ...
3 years, 8 months ago (2017-04-20 00:12:31 UTC) #72
rbpotter
https://codereview.chromium.org/2804793002/diff/300001/chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc File chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc (right): https://codereview.chromium.org/2804793002/diff/300001/chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc#newcode10 chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc:10: #include "base/auto_reset.h" On 2017/04/20 00:12:30, Lei Zhang wrote: > ...
3 years, 8 months ago (2017-04-20 00:56:23 UTC) #75
Lei Zhang
New changes lgtm. https://codereview.chromium.org/2804793002/diff/320001/chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc File chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc (right): https://codereview.chromium.org/2804793002/diff/320001/chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc#newcode25 chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc:25: using web_modal::WebContentsModalDialogManager; Not needed.
3 years, 8 months ago (2017-04-20 04:49:21 UTC) #78
Nico
lgtm!
3 years, 8 months ago (2017-04-20 14:05:54 UTC) #79
rbpotter
https://codereview.chromium.org/2804793002/diff/320001/chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc File chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc (right): https://codereview.chromium.org/2804793002/diff/320001/chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc#newcode25 chrome/browser/ui/webui/print_preview/print_preview_handler_win_unittest.cc:25: using web_modal::WebContentsModalDialogManager; On 2017/04/20 04:49:21, Lei Zhang wrote: > ...
3 years, 8 months ago (2017-04-20 16:38:52 UTC) #82
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2804793002/340001
3 years, 8 months ago (2017-04-20 17:38:49 UTC) #87
commit-bot: I haz the power
3 years, 8 months ago (2017-04-20 17:44:42 UTC) #90
Message was sent while issue was closed.
Committed patchset #14 (id:340001) as
https://chromium.googlesource.com/chromium/src/+/e5be563564bd38f1f8355406a658...

Powered by Google App Engine
This is Rietveld 408576698