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.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.graphics.Picture; | 7 import android.graphics.Picture; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 import android.os.Looper; | 9 import android.os.Looper; |
10 import android.os.Message; | 10 import android.os.Message; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 private static final int MSG_ON_PAGE_FINISHED = 9; | 117 private static final int MSG_ON_PAGE_FINISHED = 9; |
118 private static final int MSG_ON_RECEIVED_TITLE = 10; | 118 private static final int MSG_ON_RECEIVED_TITLE = 10; |
119 private static final int MSG_ON_PROGRESS_CHANGED = 11; | 119 private static final int MSG_ON_PROGRESS_CHANGED = 11; |
120 private static final int MSG_SYNTHESIZE_PAGE_LOADING = 12; | 120 private static final int MSG_SYNTHESIZE_PAGE_LOADING = 12; |
121 private static final int MSG_DO_UPDATE_VISITED_HISTORY = 13; | 121 private static final int MSG_DO_UPDATE_VISITED_HISTORY = 13; |
122 private static final int MSG_ON_FORM_RESUBMISSION = 14; | 122 private static final int MSG_ON_FORM_RESUBMISSION = 14; |
123 | 123 |
124 // Minimum period allowed between consecutive onNewPicture calls, to rate-li
mit the callbacks. | 124 // Minimum period allowed between consecutive onNewPicture calls, to rate-li
mit the callbacks. |
125 private static final long ON_NEW_PICTURE_MIN_PERIOD_MILLIS = 500; | 125 private static final long ON_NEW_PICTURE_MIN_PERIOD_MILLIS = 500; |
126 // Timestamp of the most recent onNewPicture callback. | 126 // Timestamp of the most recent onNewPicture callback. |
127 private long mLastPictureTime = 0; | 127 private long mLastPictureTime; |
128 // True when a onNewPicture callback is currenly in flight. | 128 // True when a onNewPicture callback is currenly in flight. |
129 private boolean mHasPendingOnNewPicture = false; | 129 private boolean mHasPendingOnNewPicture; |
130 | 130 |
131 private final AwContentsClient mContentsClient; | 131 private final AwContentsClient mContentsClient; |
132 | 132 |
133 private final Handler mHandler; | 133 private final Handler mHandler; |
134 | 134 |
135 private CancelCallbackPoller mCancelCallbackPoller; | 135 private CancelCallbackPoller mCancelCallbackPoller; |
136 | 136 |
137 private class MyHandler extends Handler { | 137 private class MyHandler extends Handler { |
138 private MyHandler(Looper looper) { | 138 private MyHandler(Looper looper) { |
139 super(looper); | 139 super(looper); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 public void postOnFormResubmission(Message dontResend, Message resend) { | 320 public void postOnFormResubmission(Message dontResend, Message resend) { |
321 OnFormResubmissionInfo info = new OnFormResubmissionInfo(dontResend, res
end); | 321 OnFormResubmissionInfo info = new OnFormResubmissionInfo(dontResend, res
end); |
322 mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_FORM_RESUBMISSION, in
fo)); | 322 mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_FORM_RESUBMISSION, in
fo)); |
323 } | 323 } |
324 | 324 |
325 void removeCallbacksAndMessages() { | 325 void removeCallbacksAndMessages() { |
326 mHandler.removeCallbacksAndMessages(null); | 326 mHandler.removeCallbacksAndMessages(null); |
327 } | 327 } |
328 } | 328 } |
OLD | NEW |