OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.app.SearchManager; | 9 import android.app.SearchManager; |
10 import android.content.ClipboardManager; | 10 import android.content.ClipboardManager; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 */ | 233 */ |
234 public interface NavigationTransitionDelegate { | 234 public interface NavigationTransitionDelegate { |
235 /** | 235 /** |
236 * Called when the navigation is deferred immediately after the response
started. | 236 * Called when the navigation is deferred immediately after the response
started. |
237 * | 237 * |
238 * @param enteringColor The background color of the entering document, a
s a String | 238 * @param enteringColor The background color of the entering document, a
s a String |
239 * representing a legal CSS color value. This is in
serted into | 239 * representing a legal CSS color value. This is in
serted into |
240 * the transition layer's markup after the entering
stylesheets | 240 * the transition layer's markup after the entering
stylesheets |
241 * have been applied. | 241 * have been applied. |
242 */ | 242 */ |
243 public void didDeferAfterResponseStarted(String enteringColor); | 243 public void didDeferAfterResponseStarted( |
| 244 String markup, String cssSelector, String enteringColor); |
244 | 245 |
245 /** | 246 /** |
246 * Called when a navigation transition has been detected, and we need to
check | 247 * Called when a navigation transition has been detected, and we need to
check |
247 * if it's supported. | 248 * if it's supported. |
248 */ | 249 */ |
249 public boolean willHandleDeferAfterResponseStarted(); | 250 public boolean willHandleDeferAfterResponseStarted(); |
250 | 251 |
251 /** | 252 /** |
252 * Called when the navigation is deferred immediately after the response | 253 * Called when the navigation is deferred immediately after the response |
253 * started. | 254 * started. |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 computeVerticalScrollOffset(), | 1415 computeVerticalScrollOffset(), |
1415 computeVerticalScrollExtent()); | 1416 computeVerticalScrollExtent()); |
1416 break; | 1417 break; |
1417 default: | 1418 default: |
1418 break; | 1419 break; |
1419 } | 1420 } |
1420 } | 1421 } |
1421 } | 1422 } |
1422 | 1423 |
1423 /** | 1424 /** |
| 1425 * Inserts the provided markup sandboxed into the frame. |
| 1426 */ |
| 1427 public void setupTransitionView(String markup) { |
| 1428 if (mNativeContentViewCore == 0) return; |
| 1429 nativeSetupTransitionView(mNativeContentViewCore, markup); |
| 1430 } |
| 1431 |
| 1432 /** |
| 1433 * Hides transition elements specified by the selector, and activates any |
| 1434 * exiting-transition stylesheets. |
| 1435 */ |
| 1436 public void beginExitTransition(String cssSelector) { |
| 1437 if (mNativeContentViewCore == 0) return; |
| 1438 nativeBeginExitTransition(mNativeContentViewCore, cssSelector); |
| 1439 } |
| 1440 |
| 1441 /** |
1424 * Requests the renderer insert a link to the specified stylesheet in the | 1442 * Requests the renderer insert a link to the specified stylesheet in the |
1425 * main frame's document. | 1443 * main frame's document. |
1426 */ | 1444 */ |
1427 void addStyleSheetByURL(String url) { | 1445 public void addStyleSheetByURL(String url) { |
1428 assert mWebContents != null; | 1446 assert mWebContents != null; |
1429 mWebContents.addStyleSheetByURL(url); | 1447 mWebContents.addStyleSheetByURL(url); |
1430 } | 1448 } |
1431 | 1449 |
1432 /** Callback interface for evaluateJavaScript(). */ | 1450 /** Callback interface for evaluateJavaScript(). */ |
1433 public interface JavaScriptCallback { | 1451 public interface JavaScriptCallback { |
1434 void handleJavaScriptResult(String jsonResult); | 1452 void handleJavaScriptResult(String jsonResult); |
1435 } | 1453 } |
1436 | 1454 |
1437 /** | 1455 /** |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3052 mSmartClipDataListener = listener; | 3070 mSmartClipDataListener = listener; |
3053 } | 3071 } |
3054 | 3072 |
3055 public void setBackgroundOpaque(boolean opaque) { | 3073 public void setBackgroundOpaque(boolean opaque) { |
3056 if (mNativeContentViewCore != 0) { | 3074 if (mNativeContentViewCore != 0) { |
3057 nativeSetBackgroundOpaque(mNativeContentViewCore, opaque); | 3075 nativeSetBackgroundOpaque(mNativeContentViewCore, opaque); |
3058 } | 3076 } |
3059 } | 3077 } |
3060 | 3078 |
3061 @CalledByNative | 3079 @CalledByNative |
3062 private void didDeferAfterResponseStarted(String enteringColor) { | 3080 private void didDeferAfterResponseStarted(String markup, String cssSelector, |
| 3081 String enteringColor) { |
3063 if (mNavigationTransitionDelegate != null ) { | 3082 if (mNavigationTransitionDelegate != null ) { |
3064 mNavigationTransitionDelegate.didDeferAfterResponseStarted(enteringC
olor); | 3083 mNavigationTransitionDelegate.didDeferAfterResponseStarted(markup, |
| 3084 cssSelector, enteringColor); |
3065 } | 3085 } |
3066 } | 3086 } |
3067 | 3087 |
3068 @CalledByNative | 3088 @CalledByNative |
3069 public void didStartNavigationTransitionForFrame(long frameId) { | 3089 public void didStartNavigationTransitionForFrame(long frameId) { |
3070 if (mNavigationTransitionDelegate != null ) { | 3090 if (mNavigationTransitionDelegate != null ) { |
3071 mNavigationTransitionDelegate.didStartNavigationTransitionForFrame(f
rameId); | 3091 mNavigationTransitionDelegate.didStartNavigationTransitionForFrame(f
rameId); |
3072 } | 3092 } |
3073 } | 3093 } |
3074 | 3094 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3293 long nativeContentViewCoreImpl); | 3313 long nativeContentViewCoreImpl); |
3294 | 3314 |
3295 private native void nativeWasResized(long nativeContentViewCoreImpl); | 3315 private native void nativeWasResized(long nativeContentViewCoreImpl); |
3296 | 3316 |
3297 private native void nativeSetAccessibilityEnabled( | 3317 private native void nativeSetAccessibilityEnabled( |
3298 long nativeContentViewCoreImpl, boolean enabled); | 3318 long nativeContentViewCoreImpl, boolean enabled); |
3299 | 3319 |
3300 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3320 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
3301 int x, int y, int w, int h); | 3321 int x, int y, int w, int h); |
3302 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); | 3322 private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl
, boolean opaque); |
| 3323 private native void nativeSetupTransitionView(long nativeContentViewCoreImpl
, String markup); |
| 3324 private native void nativeBeginExitTransition(long nativeContentViewCoreImpl
, |
| 3325 String cssSelector); |
3303 | 3326 |
3304 private native void nativeResumeResponseDeferredAtStart( | 3327 private native void nativeResumeResponseDeferredAtStart( |
3305 long nativeContentViewCoreImpl); | 3328 long nativeContentViewCoreImpl); |
3306 private native void nativeSetHasPendingNavigationTransitionForTesting( | 3329 private native void nativeSetHasPendingNavigationTransitionForTesting( |
3307 long nativeContentViewCoreImpl); | 3330 long nativeContentViewCoreImpl); |
3308 } | 3331 } |
OLD | NEW |