Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.Rect; | 7 import android.graphics.Rect; |
| 8 import android.graphics.RectF; | 8 import android.graphics.RectF; |
| 9 import android.os.Handler; | 9 import android.os.Handler; |
| 10 import android.os.Looper; | 10 import android.os.Looper; |
| 11 import android.os.Message; | 11 import android.os.Message; |
| 12 import android.util.Log; | 12 import android.util.Log; |
| 13 import android.view.KeyEvent; | 13 import android.view.KeyEvent; |
| 14 import android.view.View; | |
| 14 import android.webkit.ConsoleMessage; | 15 import android.webkit.ConsoleMessage; |
| 15 | 16 |
| 16 import org.chromium.content.browser.ContentViewClient; | 17 import org.chromium.content.browser.ContentViewClient; |
| 17 import org.chromium.content.browser.ContentViewCore; | 18 import org.chromium.content.browser.ContentViewCore; |
| 18 import org.chromium.content.browser.WebContentsObserverAndroid; | 19 import org.chromium.content.browser.WebContentsObserverAndroid; |
| 19 import org.chromium.net.NetError; | 20 import org.chromium.net.NetError; |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * Base-class that an AwContents embedder derives from to receive callbacks. | 23 * Base-class that an AwContents embedder derives from to receive callbacks. |
| 23 * This extends ContentViewClient, as in many cases we want to pass-thru Content ViewCore | 24 * This extends ContentViewClient, as in many cases we want to pass-thru Content ViewCore |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 } | 133 } |
| 133 | 134 |
| 134 @Override | 135 @Override |
| 135 public void showRepostFormWarningDialog(ContentViewCore contentViewCore) { | 136 public void showRepostFormWarningDialog(ContentViewCore contentViewCore) { |
| 136 Message dontResend = mHandler.obtainMessage(CANCEL_PENDING_RELOAD, c ontentViewCore); | 137 Message dontResend = mHandler.obtainMessage(CANCEL_PENDING_RELOAD, c ontentViewCore); |
| 137 Message resend = mHandler.obtainMessage(CONTINUE_PENDING_RELOAD, con tentViewCore); | 138 Message resend = mHandler.obtainMessage(CONTINUE_PENDING_RELOAD, con tentViewCore); |
| 138 AwContentsClient.this.onFormResubmission(dontResend, resend); | 139 AwContentsClient.this.onFormResubmission(dontResend, resend); |
| 139 } | 140 } |
| 140 | 141 |
| 141 @Override | 142 @Override |
| 143 public void onShowCustomView(View view) { | |
|
joth
2012/12/08 00:17:58
not needed?
acleung
2013/01/07 23:40:03
Done.
| |
| 144 AwContentsClient.this.onShowCustomView(view); | |
| 145 } | |
| 146 | |
| 147 @Override | |
| 142 public boolean addNewContents(boolean isDialog, boolean isUserGesture) { | 148 public boolean addNewContents(boolean isDialog, boolean isUserGesture) { |
| 143 return AwContentsClient.this.onCreateWindow(isDialog, isUserGesture) ; | 149 return AwContentsClient.this.onCreateWindow(isDialog, isUserGesture) ; |
| 144 } | 150 } |
| 145 | 151 |
| 146 } | 152 } |
| 147 | 153 |
| 148 class AwWebContentsObserver extends WebContentsObserverAndroid { | 154 class AwWebContentsObserver extends WebContentsObserverAndroid { |
| 149 public AwWebContentsObserver(ContentViewCore contentViewCore) { | 155 public AwWebContentsObserver(ContentViewCore contentViewCore) { |
| 150 super(contentViewCore); | 156 super(contentViewCore); |
| 151 } | 157 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 | 232 |
| 227 public abstract void onFindResultReceived(int activeMatchOrdinal, int number OfMatches, | 233 public abstract void onFindResultReceived(int activeMatchOrdinal, int number OfMatches, |
| 228 boolean isDoneCounting); | 234 boolean isDoneCounting); |
| 229 | 235 |
| 230 public abstract void onPageStarted(String url); | 236 public abstract void onPageStarted(String url); |
| 231 | 237 |
| 232 public abstract void onPageFinished(String url); | 238 public abstract void onPageFinished(String url); |
| 233 | 239 |
| 234 public abstract void onReceivedError(int errorCode, String description, Stri ng failingUrl); | 240 public abstract void onReceivedError(int errorCode, String description, Stri ng failingUrl); |
| 235 | 241 |
| 242 public abstract void onShowCustomView(View view); | |
| 243 | |
| 236 //-------------------------------------------------------------------------- ------------------ | 244 //-------------------------------------------------------------------------- ------------------ |
| 237 // Stuff that we ignore since it only makes sense for Chrome bro wser | 245 // Stuff that we ignore since it only makes sense for Chrome bro wser |
| 238 //-------------------------------------------------------------------------- ------------------ | 246 //-------------------------------------------------------------------------- ------------------ |
| 239 // | 247 // |
| 240 | 248 |
| 241 @Override | 249 @Override |
| 242 final public boolean shouldOverrideScroll(float dx, float dy, float scrollX, float scrollY) { | 250 final public boolean shouldOverrideScroll(float dx, float dy, float scrollX, float scrollY) { |
| 243 return false; | 251 return false; |
| 244 } | 252 } |
| 245 | 253 |
| 246 @Override | 254 @Override |
| 247 final public void onContextualActionBarShown() { | 255 final public void onContextualActionBarShown() { |
| 248 } | 256 } |
| 249 | 257 |
| 250 @Override | 258 @Override |
| 251 final public void onContextualActionBarHidden() { | 259 final public void onContextualActionBarHidden() { |
| 252 } | 260 } |
| 253 } | 261 } |
| OLD | NEW |