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

Issue 63483007: Refactor Android printing code to make it more testable. (Closed)

Created:
7 years, 1 month ago by cimamoglu (inactive)
Modified:
7 years, 1 month ago
CC:
chromium-reviews, nyquist
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Refactor Android printing code to make it more testable. * Move printing logic from Tab to TabBase (i.e. to upstream), and also in the relevant files tab_android.*, TabPrinter.java. * Remove obsolete Android printing feature detection code. * Move PrintingControllerFactory logic into PrintingControllerImpl. * Create a new PrintingControllerFactory, so the clients have a ligher weight creation process (5-6 lines to 1). * Instead of depending on Context to create a PrintManager, depend on an interface, namely PrintManagerDelegate. * Remove setErrorText (move the logic inside factory). * Remove the hardcoded default file name (use Printable#getTitle) instead. BUG=315229 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236256

Patch Set 1 #

Patch Set 2 : Moved isPrintingController into PrintingControllerImpl, cleaned tiny bits #

Total comments: 27

Patch Set 3 : Add PrintingControllerController #

Patch Set 4 : Fix compile issue #

Total comments: 39

Patch Set 5 : Address nyquist comments #

Patch Set 6 : Add license to PrintingControllerFactory #

Unified diffs Side-by-side diffs Delta from patch set Stats (+245 lines, -118 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/TabBase.java View 1 2 3 4 3 chunks +11 lines, -1 line 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/printing/PrintingControllerFactory.java View 1 2 3 4 5 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java View 1 2 3 4 1 chunk +52 lines, -0 lines 0 comments Download
M chrome/browser/android/tab_android.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/android/tab_android.cc View 1 2 2 chunks +15 lines, -0 lines 0 comments Download
A printing/android/java/src/org/chromium/printing/PrintManagerDelegate.java View 1 chunk +23 lines, -0 lines 0 comments Download
A printing/android/java/src/org/chromium/printing/PrintManagerDelegateImpl.java View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
M printing/android/java/src/org/chromium/printing/PrintingContext.java View 1 2 3 4 8 chunks +12 lines, -40 lines 0 comments Download
M printing/android/java/src/org/chromium/printing/PrintingController.java View 1 2 chunks +1 line, -9 lines 0 comments Download
D printing/android/java/src/org/chromium/printing/PrintingControllerFactory.java View 1 chunk +0 lines, -33 lines 0 comments Download
M printing/android/java/src/org/chromium/printing/PrintingControllerImpl.java View 1 2 3 4 10 chunks +67 lines, -34 lines 0 comments Download
M printing/printing_context_android.cc View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 14 (0 generated)
cimamoglu1
7 years, 1 month ago (2013-11-18 17:47:49 UTC) #1
Vitaly Buka (NO REVIEWS)
On 2013/11/18 17:47:49, cimamoglu1 wrote: lgtm printing/
7 years, 1 month ago (2013-11-18 19:30:46 UTC) #2
cimamoglu1
Added bulach@ for *tab* files' ownership.
7 years, 1 month ago (2013-11-19 15:15:45 UTC) #3
bulach
lgtm once whywhat is happy :) just nits below: https://codereview.chromium.org/63483007/diff/50001/chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java File chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java (right): https://codereview.chromium.org/63483007/diff/50001/chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java#newcode17 chrome/android/java/src/org/chromium/chrome/browser/printing/TabPrinter.java:17: ...
7 years, 1 month ago (2013-11-19 15:32:22 UTC) #4
whywhat
https://codereview.chromium.org/63483007/diff/50001/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java File chrome/android/java/src/org/chromium/chrome/browser/TabBase.java (right): https://codereview.chromium.org/63483007/diff/50001/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java#newcode325 chrome/android/java/src/org/chromium/chrome/browser/TabBase.java:325: /** Prints the current page. */ nit: Should be ...
7 years, 1 month ago (2013-11-19 15:39:32 UTC) #5
cimamoglu1
PTAL? https://codereview.chromium.org/63483007/diff/50001/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java File chrome/android/java/src/org/chromium/chrome/browser/TabBase.java (right): https://codereview.chromium.org/63483007/diff/50001/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java#newcode325 chrome/android/java/src/org/chromium/chrome/browser/TabBase.java:325: /** Prints the current page. */ On 2013/11/19 ...
7 years, 1 month ago (2013-11-19 17:40:32 UTC) #6
nyquist
This seemed like a cleanup-type CL, so added a few nits. Given you already have ...
7 years, 1 month ago (2013-11-20 07:44:37 UTC) #7
cimamoglu1
Thanks for interesting & thorough comments, Tommy! https://codereview.chromium.org/63483007/diff/370001/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java File chrome/android/java/src/org/chromium/chrome/browser/TabBase.java (right): https://codereview.chromium.org/63483007/diff/370001/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java#newcode327 chrome/android/java/src/org/chromium/chrome/browser/TabBase.java:327: * @return ...
7 years, 1 month ago (2013-11-20 14:40:34 UTC) #8
whywhat
lgtm
7 years, 1 month ago (2013-11-20 14:42:04 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cimamoglu@chromium.org/63483007/480001
7 years, 1 month ago (2013-11-20 14:42:44 UTC) #10
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=37203
7 years, 1 month ago (2013-11-20 14:57:48 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cimamoglu@chromium.org/63483007/600001
7 years, 1 month ago (2013-11-20 15:01:13 UTC) #12
commit-bot: I haz the power
Change committed as 236256
7 years, 1 month ago (2013-11-20 16:52:23 UTC) #13
cjhopman
7 years, 1 month ago (2013-11-20 20:54:02 UTC) #14
Message was sent while issue was closed.
On 2013/11/20 16:52:23, I haz the power (commit-bot) wrote:
> Change committed as 236256

Is this code untested? I think PrintingControllerFactory.create throws a
NoClassDefFoundError on pre-K builds.

Powered by Google App Engine
This is Rietveld 408576698