| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.download; | 5 package org.chromium.chrome.browser.download; |
| 6 | 6 |
| 7 import org.chromium.base.annotations.CalledByNative; | 7 import org.chromium.base.annotations.CalledByNative; |
| 8 import org.chromium.content_public.browser.DownloadState; | 8 import org.chromium.content_public.browser.DownloadState; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 return mContentDisposition; | 113 return mContentDisposition; |
| 114 } | 114 } |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * @return percent completed as an integer, -1 if there is no download progr
ess. | 117 * @return percent completed as an integer, -1 if there is no download progr
ess. |
| 118 */ | 118 */ |
| 119 public int getPercentCompleted() { | 119 public int getPercentCompleted() { |
| 120 return mPercentCompleted; | 120 return mPercentCompleted; |
| 121 } | 121 } |
| 122 | 122 |
| 123 /** |
| 124 * @return Remaining download time in milliseconds or -1 if it is unknown. |
| 125 */ |
| 123 public long getTimeRemainingInMillis() { | 126 public long getTimeRemainingInMillis() { |
| 124 return mTimeRemainingInMillis; | 127 return mTimeRemainingInMillis; |
| 125 } | 128 } |
| 126 | 129 |
| 127 public boolean isResumable() { | 130 public boolean isResumable() { |
| 128 return mIsResumable; | 131 return mIsResumable; |
| 129 } | 132 } |
| 130 | 133 |
| 131 public boolean isPaused() { | 134 public boolean isPaused() { |
| 132 return mIsPaused; | 135 return mIsPaused; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 .setIsResumable(isResumable) | 335 .setIsResumable(isResumable) |
| 333 .setMimeType(remappedMimeType) | 336 .setMimeType(remappedMimeType) |
| 334 .setOriginalUrl(originalUrl) | 337 .setOriginalUrl(originalUrl) |
| 335 .setPercentCompleted(percentCompleted) | 338 .setPercentCompleted(percentCompleted) |
| 336 .setReferrer(referrerUrl) | 339 .setReferrer(referrerUrl) |
| 337 .setState(state) | 340 .setState(state) |
| 338 .setTimeRemainingInMillis(timeRemainingInMs) | 341 .setTimeRemainingInMillis(timeRemainingInMs) |
| 339 .setUrl(url).build(); | 342 .setUrl(url).build(); |
| 340 } | 343 } |
| 341 } | 344 } |
| OLD | NEW |