| 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.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.util.AttributeSet; | 8 import android.util.AttributeSet; |
| 9 import android.util.Log; | 9 import android.util.Log; |
| 10 import android.view.View; | 10 import android.view.View; |
| 11 import android.webkit.DownloadListener; | 11 import android.webkit.DownloadListener; |
| 12 import android.widget.FrameLayout; | 12 import android.widget.FrameLayout; |
| 13 | 13 |
| 14 import org.chromium.base.WeakContext; | 14 import org.chromium.base.WeakContext; |
| 15 import org.chromium.content.app.AppResource; |
| 15 import org.chromium.content.common.TraceEvent; | 16 import org.chromium.content.common.TraceEvent; |
| 16 | 17 |
| 17 public class ContentView extends FrameLayout { | 18 public class ContentView extends FrameLayout { |
| 18 | 19 |
| 19 // The following constants match the ones in chrome/common/page_transition_t
ypes.h. | 20 // The following constants match the ones in chrome/common/page_transition_t
ypes.h. |
| 20 // Add more if you need them. | 21 // Add more if you need them. |
| 21 public static final int PAGE_TRANSITION_LINK = 0; | 22 public static final int PAGE_TRANSITION_LINK = 0; |
| 22 public static final int PAGE_TRANSITION_TYPED = 1; | 23 public static final int PAGE_TRANSITION_TYPED = 1; |
| 23 public static final int PAGE_TRANSITION_AUTO_BOOKMARK = 2; | 24 public static final int PAGE_TRANSITION_AUTO_BOOKMARK = 2; |
| 24 public static final int PAGE_TRANSITION_START_PAGE = 6; | 25 public static final int PAGE_TRANSITION_START_PAGE = 6; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 * process until the maximum number of processes is reached. The special val
ue of | 89 * process until the maximum number of processes is reached. The special val
ue of |
| 89 * MAX_RENDERERS_SINGLE_PROCESS requests single-process mode where the rende
rer will run in the | 90 * MAX_RENDERERS_SINGLE_PROCESS requests single-process mode where the rende
rer will run in the |
| 90 * application process in a separate thread. If the special value MAX_RENDER
ERS_AUTOMATIC is | 91 * application process in a separate thread. If the special value MAX_RENDER
ERS_AUTOMATIC is |
| 91 * used then the number of renderers will be determined based on the device
memory class. The | 92 * used then the number of renderers will be determined based on the device
memory class. The |
| 92 * maximum number of allowed renderers is capped by MAX_RENDERERS_LIMIT. | 93 * maximum number of allowed renderers is capped by MAX_RENDERERS_LIMIT. |
| 93 */ | 94 */ |
| 94 public static void enableMultiProcess(Context context, int maxRendererProces
ses) { | 95 public static void enableMultiProcess(Context context, int maxRendererProces
ses) { |
| 95 AndroidBrowserProcess.initContentViewProcess(context, maxRendererProcess
es); | 96 AndroidBrowserProcess.initContentViewProcess(context, maxRendererProcess
es); |
| 96 } | 97 } |
| 97 | 98 |
| 98 /** | |
| 99 * Registers the drawable to be used for overlaying the popup zoomer content
s. The drawable | |
| 100 * should be transparent in the middle to allow the zoomed content to show. | |
| 101 * | |
| 102 * @param id The id of the drawable to be used to overlay the popup zoomer c
ontents. | |
| 103 */ | |
| 104 public static void registerPopupOverlayResourceId(int id) { | |
| 105 // TODO(tedchoc): Implement. | |
| 106 } | |
| 107 | |
| 108 /** | |
| 109 * Sets how much to round the corners of the popup contents. | |
| 110 * @param r The radius of the rounded corners of the popup overlay drawable. | |
| 111 */ | |
| 112 public static void registerPopupOverlayCornerRadius(float r) { | |
| 113 // TODO(tedchoc): Implement. | |
| 114 } | |
| 115 | |
| 116 public ContentView(Context context, int nativeWebContents, int personality)
{ | 99 public ContentView(Context context, int nativeWebContents, int personality)
{ |
| 117 this(context, nativeWebContents, null, android.R.attr.webViewStyle, pers
onality); | 100 this(context, nativeWebContents, null, android.R.attr.webViewStyle, pers
onality); |
| 118 } | 101 } |
| 119 | 102 |
| 120 private ContentView(Context context, int nativeWebContents, AttributeSet att
rs, int defStyle, | 103 private ContentView(Context context, int nativeWebContents, AttributeSet att
rs, int defStyle, |
| 121 int personality) { | 104 int personality) { |
| 122 super(context, attrs, defStyle); | 105 super(context, attrs, defStyle); |
| 123 | 106 |
| 124 WeakContext.initializeWeakContext(context); | 107 WeakContext.initializeWeakContext(context); |
| 125 // By default, ContentView will initialize single process mode. The call
to | 108 // By default, ContentView will initialize single process mode. The call
to |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 private native void nativeGoForward(int nativeContentViewImpl); | 592 private native void nativeGoForward(int nativeContentViewImpl); |
| 610 | 593 |
| 611 private native void nativeStopLoading(int nativeContentViewImpl); | 594 private native void nativeStopLoading(int nativeContentViewImpl); |
| 612 | 595 |
| 613 private native void nativeReload(int nativeContentViewImpl); | 596 private native void nativeReload(int nativeContentViewImpl); |
| 614 | 597 |
| 615 private native boolean nativeNeedsReload(int nativeContentViewImpl); | 598 private native boolean nativeNeedsReload(int nativeContentViewImpl); |
| 616 | 599 |
| 617 private native void nativeClearHistory(int nativeContentViewImpl); | 600 private native void nativeClearHistory(int nativeContentViewImpl); |
| 618 } | 601 } |
| OLD | NEW |