| 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_public.browser; | 5 package org.chromium.content_public.browser; |
| 6 | 6 |
| 7 import org.chromium.base.VisibleForTesting; | 7 import org.chromium.base.VisibleForTesting; |
| 8 import org.chromium.base.annotations.JNINamespace; | 8 import org.chromium.base.annotations.JNINamespace; |
| 9 import org.chromium.base.annotations.SuppressFBWarnings; | 9 import org.chromium.base.annotations.SuppressFBWarnings; |
| 10 import org.chromium.content_public.browser.navigation_controller.LoadURLType; | 10 import org.chromium.content_public.browser.navigation_controller.LoadURLType; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 Referrer mReferrer; | 32 Referrer mReferrer; |
| 33 private Map<String, String> mExtraHeaders; | 33 private Map<String, String> mExtraHeaders; |
| 34 private String mVerbatimHeaders; | 34 private String mVerbatimHeaders; |
| 35 int mUaOverrideOption; | 35 int mUaOverrideOption; |
| 36 byte[] mPostData; | 36 byte[] mPostData; |
| 37 String mBaseUrlForDataUrl; | 37 String mBaseUrlForDataUrl; |
| 38 String mVirtualUrlForDataUrl; | 38 String mVirtualUrlForDataUrl; |
| 39 boolean mCanLoadLocalResources; | 39 boolean mCanLoadLocalResources; |
| 40 boolean mIsRendererInitiated; | 40 boolean mIsRendererInitiated; |
| 41 long mIntentReceivedTimestamp; | 41 long mIntentReceivedTimestamp; |
| 42 boolean mHasUserGesture; |
| 42 | 43 |
| 43 /** | 44 /** |
| 44 * Creates an instance with default page transition type. | 45 * Creates an instance with default page transition type. |
| 45 * @param url the url to be loaded | 46 * @param url the url to be loaded |
| 46 */ | 47 */ |
| 47 public LoadUrlParams(String url) { | 48 public LoadUrlParams(String url) { |
| 48 this(url, PageTransition.LINK); | 49 this(url, PageTransition.LINK); |
| 49 } | 50 } |
| 50 | 51 |
| 51 /** | 52 /** |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 mIntentReceivedTimestamp = intentReceivedTimestamp; | 401 mIntentReceivedTimestamp = intentReceivedTimestamp; |
| 401 } | 402 } |
| 402 | 403 |
| 403 /** | 404 /** |
| 404 * @return The timestamp at which Chrome received the intent that triggered
this URL load. | 405 * @return The timestamp at which Chrome received the intent that triggered
this URL load. |
| 405 */ | 406 */ |
| 406 public long getIntentReceivedTimestamp() { | 407 public long getIntentReceivedTimestamp() { |
| 407 return mIntentReceivedTimestamp; | 408 return mIntentReceivedTimestamp; |
| 408 } | 409 } |
| 409 | 410 |
| 411 /** |
| 412 * Set whether the load is initiated by a user gesture. |
| 413 * |
| 414 * @param hasUserGesture True if load is initiated by user gesture, or false
otherwise. |
| 415 */ |
| 416 public void setHasUserGesture(boolean hasUserGesture) { |
| 417 mHasUserGesture = hasUserGesture; |
| 418 } |
| 419 |
| 420 /** |
| 421 * @return Whether or not this load was initiated with a user gesture. |
| 422 */ |
| 423 public boolean getHasUserGesture() { |
| 424 return mHasUserGesture; |
| 425 } |
| 426 |
| 410 public boolean isBaseUrlDataScheme() { | 427 public boolean isBaseUrlDataScheme() { |
| 411 // If there's no base url set, but this is a data load then | 428 // If there's no base url set, but this is a data load then |
| 412 // treat the scheme as data:. | 429 // treat the scheme as data:. |
| 413 if (mBaseUrlForDataUrl == null && mLoadUrlType == LoadURLType.DATA) { | 430 if (mBaseUrlForDataUrl == null && mLoadUrlType == LoadURLType.DATA) { |
| 414 return true; | 431 return true; |
| 415 } | 432 } |
| 416 return nativeIsDataScheme(mBaseUrlForDataUrl); | 433 return nativeIsDataScheme(mBaseUrlForDataUrl); |
| 417 } | 434 } |
| 418 | 435 |
| 419 /** | 436 /** |
| 420 * Parses |url| as a GURL on the native side, and | 437 * Parses |url| as a GURL on the native side, and |
| 421 * returns true if it's scheme is data:. | 438 * returns true if it's scheme is data:. |
| 422 */ | 439 */ |
| 423 private static native boolean nativeIsDataScheme(String url); | 440 private static native boolean nativeIsDataScheme(String url); |
| 424 } | 441 } |
| OLD | NEW |