├── .gitignore ├── DEPS ├── DEPS.mogo ├── LICENSE ├── README.md ├── build ├── adb_gdb_chromeview_shell └── envsetup.sh ├── chromeview.gyp ├── java ├── AndroidManifest.xml ├── assets │ └── webviewchromium.pak ├── libs │ ├── android-support-v4.jar │ ├── armeabi-v7a │ │ ├── gdbserver │ │ └── libchromeview.so │ ├── guava_javalib.jar │ └── jsr_305_javalib.jar ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ ├── autofill_popup_background_down.9.png │ │ ├── autofill_popup_background_up.9.png │ │ ├── bubble.9.png │ │ ├── bubble_arrow_up.png │ │ ├── color_picker_advanced_select_handle.png │ │ ├── ic_find_next_holo_light.png │ │ ├── ic_find_previous_holo_light.png │ │ ├── ic_launcher.png │ │ ├── ic_media_video_poster.png │ │ ├── ic_menu_search_holo_light.png │ │ ├── ic_menu_share_holo_light.png │ │ ├── ondemand_overlay.9.png │ │ └── pageinfo_warning_major.png │ ├── drawable-ldpi │ │ └── ic_media_video_poster.png │ ├── drawable-mdpi │ │ ├── ic_find_next_holo_light.png │ │ ├── ic_find_previous_holo_light.png │ │ ├── ic_launcher.png │ │ └── ic_media_video_poster.png │ ├── drawable-xhdpi │ │ ├── autofill_popup_background_down.9.png │ │ ├── autofill_popup_background_up.9.png │ │ ├── bubble.9.png │ │ ├── bubble_arrow_up.png │ │ ├── color_picker_advanced_select_handle.png │ │ ├── ic_find_next_holo_light.png │ │ ├── ic_find_previous_holo_light.png │ │ ├── ic_launcher.png │ │ ├── ic_media_video_poster.png │ │ ├── ic_menu_search_holo_light.png │ │ ├── ic_menu_share_holo_light.png │ │ ├── ondemand_overlay.9.png │ │ └── pageinfo_warning_major.png │ ├── drawable │ │ ├── autofill_popup_background.xml │ │ ├── autofill_popup_background_down.9.png │ │ ├── autofill_popup_background_up.9.png │ │ ├── bubble.9.png │ │ ├── bubble_arrow_up.png │ │ ├── color_button_background.xml │ │ ├── color_picker_advanced_select_handle.png │ │ ├── color_picker_border.xml │ │ ├── ic_menu_search_holo_light.png │ │ ├── ic_menu_share_holo_light.png │ │ ├── ondemand_overlay.9.png │ │ └── pageinfo_warning_major.png │ ├── layout-land │ │ └── date_time_picker_dialog.xml │ ├── layout │ │ ├── autofill_text.xml │ │ ├── color_picker_advanced_component.xml │ │ ├── color_picker_dialog_content.xml │ │ ├── color_picker_dialog_title.xml │ │ ├── date_time_picker_dialog.xml │ │ ├── date_time_suggestion.xml │ │ ├── js_prompt.xml │ │ ├── multi_field_time_picker_dialog.xml │ │ ├── two_field_date_picker.xml │ │ ├── validation_message_bubble.xml │ │ └── webview_find.xml │ ├── menu │ │ ├── select_action_menu.xml │ │ └── webview_find.xml │ ├── mipmap-hdpi │ │ └── app_icon.png │ ├── mipmap-mdpi │ │ └── app_icon.png │ ├── mipmap-xhdpi │ │ └── app_icon.png │ ├── mipmap-xxhdpi │ │ └── app_icon.png │ ├── raw-zh-rCN │ │ ├── loaderror.html │ │ └── nodomain.html │ ├── raw │ │ ├── loaderror.html │ │ └── nodomain.html │ ├── values-v11 │ │ └── styles.xml │ ├── values-v14 │ │ └── styles.xml │ ├── values-v17 │ │ ├── styles_content.xml │ │ └── styles_ui.xml │ ├── values-zh-rCN │ │ ├── android_content_strings.xml │ │ ├── android_ui_strings.xml │ │ └── strings.xml │ └── values │ │ ├── android_content_strings.xml │ │ ├── android_ui_strings.xml │ │ ├── attrs_content.xml │ │ ├── colors_ui.xml │ │ ├── dimens_content.xml │ │ ├── dimens_ui.xml │ │ ├── strings.xml │ │ ├── strings_content.xml │ │ ├── strings_ui.xml │ │ ├── styles.xml │ │ └── values_ui.xml └── src │ ├── OWNERS │ ├── com │ ├── googlecode │ │ └── eyesfree │ │ │ └── braille │ │ │ ├── display │ │ │ ├── BrailleDisplayProperties.aidl │ │ │ ├── BrailleDisplayProperties.java │ │ │ ├── BrailleInputEvent.aidl │ │ │ ├── BrailleInputEvent.java │ │ │ ├── BrailleKeyBinding.java │ │ │ ├── Display.java │ │ │ ├── IBrailleService.aidl │ │ │ └── IBrailleServiceCallback.aidl │ │ │ ├── selfbraille │ │ │ ├── ISelfBrailleService.aidl │ │ │ ├── SelfBrailleClient.java │ │ │ ├── WriteData.aidl │ │ │ └── WriteData.java │ │ │ └── translate │ │ │ ├── BrailleTranslator.java │ │ │ ├── ITranslatorService.aidl │ │ │ ├── ITranslatorServiceCallback.aidl │ │ │ └── TranslatorManager.java │ └── mogoweb │ │ └── chrome │ │ ├── CookieManager.java │ │ ├── DownloadListener.java │ │ ├── GeolocationPermissions.java │ │ ├── HttpAuthHandler.java │ │ ├── JavascriptInterface.java │ │ ├── JsPromptResult.java │ │ ├── JsResult.java │ │ ├── MustOverrideException.java │ │ ├── SslErrorHandler.java │ │ ├── WebBackForwardList.java │ │ ├── WebChromeClient.java │ │ ├── WebHistoryItem.java │ │ ├── WebIconDatabase.java │ │ ├── WebSettings.java │ │ ├── WebStorage.java │ │ ├── WebView.java │ │ ├── WebViewClient.java │ │ ├── WebViewDatabase.java │ │ ├── WebViewFragment.java │ │ └── impl │ │ ├── ContentSettingsAdapter.java │ │ ├── CookieManagerAdapter.java │ │ ├── DebugFlags.java │ │ ├── DrawGLFunctor.java │ │ ├── FindActionModeCallback.java │ │ ├── GeolocationPermissionsAdapter.java │ │ ├── JsDialogHelper.java │ │ ├── ResourceProvider.java │ │ ├── UnimplementedWebViewApi.java │ │ ├── WebBackForwardListChromium.java │ │ ├── WebHistoryItemChromium.java │ │ ├── WebIconDatabaseAdapter.java │ │ ├── WebStorageAdapter.java │ │ ├── WebViewChromium.java │ │ ├── WebViewChromiumFactoryProvider.java │ │ ├── WebViewContentsClientAdapter.java │ │ ├── WebViewDatabaseAdapter.java │ │ ├── WebViewFactory.java │ │ ├── WebViewFactoryProvider.java │ │ └── WebViewProvider.java │ └── org │ └── chromium │ ├── android_webview │ ├── AndroidProtocolHandler.java │ ├── AwAutofillManagerDelegate.java │ ├── AwBrowserContext.java │ ├── AwBrowserProcess.java │ ├── AwContentViewClient.java │ ├── AwContents.java │ ├── AwContentsClient.java │ ├── AwContentsClientBridge.java │ ├── AwContentsClientCallbackHelper.java │ ├── AwContentsIoThreadClient.java │ ├── AwCookieManager.java │ ├── AwDevToolsServer.java │ ├── AwFormDatabase.java │ ├── AwGeolocationPermissions.java │ ├── AwHttpAuthHandler.java │ ├── AwLayoutSizer.java │ ├── AwPdfExporter.java │ ├── AwPicture.java │ ├── AwPrintDocumentAdapter.java │ ├── AwQuotaManagerBridge.java │ ├── AwResource.java │ ├── AwScrollOffsetManager.java │ ├── AwSettings.java │ ├── AwWebContentsDelegate.java │ ├── AwWebContentsDelegateAdapter.java │ ├── AwZoomControls.java │ ├── DefaultVideoPosterRequestHandler.java │ ├── ErrorCodeConversionHelper.java │ ├── HttpAuthDatabase.java │ ├── InterceptedRequestData.java │ ├── JavaBrowserViewRendererHelper.java │ ├── JsPromptResultReceiver.java │ ├── JsResultHandler.java │ ├── JsResultReceiver.java │ ├── OverScrollGlow.java │ ├── ScrollAccessibilityHelper.java │ └── SslUtil.java │ ├── base │ ├── AccessedByNative.java │ ├── ActivityState.java │ ├── ActivityState.template │ ├── ActivityStatus.java │ ├── ApiCompatibilityUtils.java │ ├── BaseChromiumApplication.java │ ├── BaseSwitches.java │ ├── BuildInfo.java │ ├── CalledByNative.java │ ├── CalledByNativeUnchecked.java │ ├── ChromiumApplication.java │ ├── CollectionUtil.java │ ├── CommandLine.java │ ├── ContentUriUtils.java │ ├── ContextTypes.java │ ├── CpuFeatures.java │ ├── ImportantFileWriterAndroid.java │ ├── JNINamespace.java │ ├── JavaHandlerThread.java │ ├── MemoryPressureLevelList.java │ ├── MemoryPressureLevelList.template │ ├── MemoryPressureListener.java │ ├── NativeClassQualifiedName.java │ ├── ObserverList.java │ ├── PathService.java │ ├── PathUtils.java │ ├── PerfTraceEvent.java │ ├── PowerMonitor.java │ ├── PowerStatusReceiver.java │ ├── SysUtils.java │ ├── SystemMessageHandler.java │ ├── ThreadUtils.java │ ├── TraceEvent.java │ ├── WeakContext.java │ └── library_loader │ │ ├── LibraryLoader.java │ │ ├── LibraryLoaderHelper.java │ │ ├── Linker.java │ │ ├── LoaderErrors.java │ │ ├── NativeLibraries.java │ │ └── ProcessInitException.java │ ├── chrome │ ├── R.java │ └── browser │ │ ├── ResourceId.java │ │ ├── sync │ │ └── ModelTypeSelection.java │ │ └── ui │ │ └── toolbar │ │ └── ToolbarModelSecurityLevel.java │ ├── components │ ├── navigation_interception │ │ ├── InterceptNavigationDelegate.java │ │ └── NavigationParams.java │ └── web_contents_delegate_android │ │ ├── ColorChooserAndroid.java │ │ ├── ValidationMessageBubble.java │ │ └── WebContentsDelegateAndroid.java │ ├── content │ ├── R.java │ ├── app │ │ ├── ChildProcessService.java │ │ ├── ChromiumLinkerParams.java │ │ ├── ContentApplication.java │ │ ├── ContentMain.java │ │ ├── LinkerParams.java │ │ ├── PrivilegedProcessService.java │ │ ├── PrivilegedProcessService0.java │ │ ├── PrivilegedProcessService1.java │ │ ├── PrivilegedProcessService2.java │ │ ├── SandboxedProcessService.java │ │ ├── SandboxedProcessService0.java │ │ ├── SandboxedProcessService1.java │ │ ├── SandboxedProcessService10.java │ │ ├── SandboxedProcessService11.java │ │ ├── SandboxedProcessService12.java │ │ ├── SandboxedProcessService2.java │ │ ├── SandboxedProcessService3.java │ │ ├── SandboxedProcessService4.java │ │ ├── SandboxedProcessService5.java │ │ ├── SandboxedProcessService6.java │ │ ├── SandboxedProcessService7.java │ │ ├── SandboxedProcessService8.java │ │ └── SandboxedProcessService9.java │ ├── browser │ │ ├── ActivityContentVideoViewClient.java │ │ ├── BindingManager.java │ │ ├── BindingManagerImpl.java │ │ ├── BrowserStartupController.java │ │ ├── ChildProcessConnection.java │ │ ├── ChildProcessConnectionImpl.java │ │ ├── ChildProcessLauncher.java │ │ ├── ContentSettings.java │ │ ├── ContentVideoView.java │ │ ├── ContentVideoViewClient.java │ │ ├── ContentVideoViewControls.java │ │ ├── ContentVideoViewLegacy.java │ │ ├── ContentView.java │ │ ├── ContentViewClient.java │ │ ├── ContentViewCore.java │ │ ├── ContentViewDownloadDelegate.java │ │ ├── ContentViewGestureHandler.java │ │ ├── ContentViewRenderView.java │ │ ├── ContentViewStatics.java │ │ ├── DeviceMotionAndOrientation.java │ │ ├── DeviceUtils.java │ │ ├── DownloadController.java │ │ ├── DownloadInfo.java │ │ ├── FileDescriptorInfo.java │ │ ├── GenericTouchGesture.java │ │ ├── GestureEventType.java │ │ ├── GestureEventType.template │ │ ├── HeapStatsLogger.java │ │ ├── InterstitialPageDelegateAndroid.java │ │ ├── JavascriptInterface.java │ │ ├── JellyBeanContentView.java │ │ ├── LoadUrlParams.java │ │ ├── LocationProvider.java │ │ ├── LocationProviderAdapter.java │ │ ├── LocationProviderFactory.java │ │ ├── LongPressDetector.java │ │ ├── MediaDrmCredentialManager.java │ │ ├── MediaResourceGetter.java │ │ ├── NavigationClient.java │ │ ├── NavigationEntry.java │ │ ├── NavigationHistory.java │ │ ├── OWNERS │ │ ├── PageInfo.java │ │ ├── PageTransitionTypes.java │ │ ├── PageTransitionTypes.template │ │ ├── PepperPluginManager.java │ │ ├── PopupZoomer.java │ │ ├── PositionObserver.java │ │ ├── PowerSaveBlocker.java │ │ ├── RenderCoordinates.java │ │ ├── ResourceExtractor.java │ │ ├── SelectActionModeCallback.java │ │ ├── SnapScrollController.java │ │ ├── SpeechRecognition.java │ │ ├── SpeechRecognitionError.java │ │ ├── SpeechRecognitionError.template │ │ ├── TouchEventSynthesizer.java │ │ ├── TouchPoint.java │ │ ├── TracingControllerAndroid.java │ │ ├── TracingIntentHandler.java │ │ ├── VSyncManager.java │ │ ├── VSyncMonitor.java │ │ ├── VibrationMessageFilter.java │ │ ├── VibrationProvider.java │ │ ├── ViewPositionObserver.java │ │ ├── WebContentsObserverAndroid.java │ │ ├── accessibility │ │ │ ├── AccessibilityInjector.java │ │ │ ├── BrowserAccessibilityManager.java │ │ │ ├── JellyBeanAccessibilityInjector.java │ │ │ ├── JellyBeanBrowserAccessibilityManager.java │ │ │ └── KitKatBrowserAccessibilityManager.java │ │ ├── framehost │ │ │ └── NavigationControllerImpl.java │ │ ├── input │ │ │ ├── AdapterInputConnection.java │ │ │ ├── CursorController.java │ │ │ ├── DateDialogNormalizer.java │ │ │ ├── DateTimeChooserAndroid.java │ │ │ ├── DateTimePickerDialog.java │ │ │ ├── DateTimeSuggestion.java │ │ │ ├── DateTimeSuggestionListAdapter.java │ │ │ ├── HandleView.java │ │ │ ├── ImeAdapter.java │ │ │ ├── InputDialogContainer.java │ │ │ ├── InputMethodManagerWrapper.java │ │ │ ├── InsertionHandleController.java │ │ │ ├── MonthPicker.java │ │ │ ├── MonthPickerDialog.java │ │ │ ├── MultiFieldTimePickerDialog.java │ │ │ ├── PopupItemType.java │ │ │ ├── PopupItemType.template │ │ │ ├── SelectPopupAdapter.java │ │ │ ├── SelectPopupDialog.java │ │ │ ├── SelectPopupItem.java │ │ │ ├── SelectionHandleController.java │ │ │ ├── TwoFieldDatePicker.java │ │ │ ├── TwoFieldDatePickerDialog.java │ │ │ ├── WeekPicker.java │ │ │ └── WeekPickerDialog.java │ │ ├── third_party │ │ │ └── GestureDetector.java │ │ └── webcontents │ │ │ └── WebContentsImpl.java │ └── common │ │ ├── CleanupReference.java │ │ ├── CommandLine.java │ │ ├── ContentSwitches.java │ │ ├── DeviceTelephonyInfo.java │ │ ├── IChildProcessCallback.aidl │ │ ├── IChildProcessService.aidl │ │ ├── PerfTraceEvent.java │ │ ├── ResultCodes.java │ │ ├── ResultCodes.template │ │ ├── TopControlsState.java │ │ ├── TopControlsState.template │ │ └── TraceEvent.java │ ├── content_public │ ├── DEPS │ └── browser │ │ ├── GestureStateListener.java │ │ ├── NavigationController.java │ │ └── WebContents.java │ ├── media │ ├── AudioManagerAndroid.java │ ├── AudioRecordInput.java │ ├── ImageFormat.java │ ├── ImageFormat.template │ ├── MediaCodecBridge.java │ ├── MediaDrmBridge.java │ ├── MediaPlayerBridge.java │ ├── MediaPlayerListener.java │ ├── UsbMidiDeviceAndroid.java │ ├── UsbMidiDeviceFactoryAndroid.java │ ├── VideoCapture.java │ └── WebAudioMediaCodecBridge.java │ ├── net │ ├── AndroidCertVerifyResult.java │ ├── AndroidKeyStore.java │ ├── AndroidNetworkLibrary.java │ ├── AndroidPrivateKey.java │ ├── CertVerifyResultAndroid.java │ ├── CertVerifyStatusAndroid.java │ ├── CertificateMimeType.java │ ├── DefaultAndroidKeyStore.java │ ├── GURLUtils.java │ ├── IRemoteAndroidKeyStore.aidl │ ├── IRemoteAndroidKeyStoreCallbacks.aidl │ ├── NetError.java │ ├── NetworkChangeNotifier.java │ ├── NetworkChangeNotifierAutoDetect.java │ ├── PrivateKeyType.java │ ├── ProxyChangeListener.java │ ├── RemoteAndroidKeyStore.java │ └── X509Util.java │ └── ui │ ├── Clipboard.java │ ├── ColorPickerAdvanced.java │ ├── ColorPickerAdvancedComponent.java │ ├── ColorPickerDialog.java │ ├── ColorPickerMoreButton.java │ ├── ColorPickerSimple.java │ ├── ColorSuggestion.java │ ├── ColorSuggestionListAdapter.java │ ├── LocalizationUtils.java │ ├── OnColorChangedListener.java │ ├── R.java │ ├── SelectFileDialog.java │ ├── UiUtils.java │ ├── ViewAndroid.java │ ├── ViewAndroidDelegate.java │ ├── WindowAndroid.java │ ├── WindowOpenDisposition.java │ ├── autofill │ ├── AutofillDividerDrawable.java │ ├── AutofillListAdapter.java │ ├── AutofillPopup.java │ └── AutofillSuggestion.java │ ├── base │ ├── ActivityWindowAndroid.java │ ├── Clipboard.java │ ├── LocalizationUtils.java │ ├── SelectFileDialog.java │ ├── ViewAndroid.java │ ├── ViewAndroidDelegate.java │ └── WindowAndroid.java │ ├── gfx │ ├── BitmapHelper.java │ ├── DeviceDisplayInfo.java │ ├── SurfaceTextureListener.java │ └── SurfaceTexturePlatformWrapper.java │ └── gl │ ├── SurfaceTextureListener.java │ └── SurfaceTexturePlatformWrapper.java ├── native ├── draw_gl_functor.cpp ├── jni_entry_point.cpp ├── private │ └── hwui │ │ └── DrawGlInfo.h └── utils │ ├── Errors.h │ └── Functor.h ├── sync.sh ├── testshell ├── java │ ├── AndroidManifest.xml │ ├── assets │ │ └── webviewchromium.pak │ ├── ic_launcher-web.png │ ├── libs │ │ └── android-support-v4.jar │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable │ │ │ └── progress.xml │ │ ├── layout │ │ │ ├── http_authentication.xml │ │ │ └── testshell_activity.xml │ │ ├── menu │ │ │ └── main.xml │ │ ├── values-sw600dp │ │ │ └── dimens.xml │ │ ├── values-sw720dp-land │ │ │ └── dimens.xml │ │ ├── values-v11 │ │ │ └── styles.xml │ │ ├── values-v14 │ │ │ └── styles.xml │ │ ├── values-zh-rCN │ │ │ └── strings.xml │ │ └── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ └── src │ │ └── com │ │ └── mogoweb │ │ └── chrome │ │ └── shell │ │ ├── HttpAuthenticationDialog.java │ │ ├── PageDialogsHandler.java │ │ ├── ShellActivity.java │ │ └── ShellApplication.java └── javatests │ ├── AndroidManifest.xml │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ └── values │ │ └── strings.xml │ └── src │ ├── com │ └── mogoweb │ │ └── chrome │ │ └── shell │ │ └── test │ │ ├── BackForwardListTest.java │ │ ├── ClientOnPageFinishedTest.java │ │ ├── TestWebViewClient.java │ │ ├── WebViewShellTestBase.java │ │ └── WebViewShellUrlTest.java │ └── org │ └── chromium │ ├── base │ └── test │ │ └── util │ │ ├── AdvancedMockContext.java │ │ ├── DisabledTest.java │ │ ├── EnormousTest.java │ │ ├── Feature.java │ │ ├── HostDrivenTest.java │ │ ├── InMemorySharedPreferences.java │ │ ├── InstrumentationUtils.java │ │ ├── PhoneOnly.java │ │ ├── Restriction.java │ │ ├── ScalableTimeout.java │ │ ├── TabletOnly.java │ │ ├── TestFileUtil.java │ │ ├── TestThread.java │ │ ├── TimeoutScale.java │ │ └── UrlUtils.java │ └── content │ └── browser │ └── test │ ├── NestedSystemMessageHandler.java │ └── util │ ├── CallbackHelper.java │ ├── Criteria.java │ ├── CriteriaHelper.java │ ├── DOMUtils.java │ ├── HistoryUtils.java │ ├── JavaScriptUtils.java │ ├── KeyUtils.java │ ├── MockLocationProvider.java │ ├── TestCallbackHelperContainer.java │ ├── TestContentViewClient.java │ ├── TestContentViewClientWrapper.java │ ├── TestInputMethodManagerWrapper.java │ ├── TestTouchUtils.java │ ├── TestWebContentsObserver.java │ ├── TouchCommon.java │ └── UiUtils.java └── tools ├── fetch_deps.py ├── generate_gclient-mogo.py ├── mirror_repo_from_google.py └── utils.py /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Eclipse project files 19 | .classpath 20 | .project 21 | .settings 22 | -------------------------------------------------------------------------------- /DEPS: -------------------------------------------------------------------------------- 1 | include_rules = [ 2 | "+content/public", 3 | 4 | "+crypto", 5 | "+net", 6 | "+sandbox", 7 | "+skia", 8 | "+ui", 9 | "+v8", 10 | "+webkit", 11 | 12 | # Allow inclusion of third-party code. 13 | "+third_party/skia", 14 | "+third_party/WebKit/public/platform", 15 | "+third_party/WebKit/public/web", 16 | 17 | # Files generated during Crosswalk build. 18 | "+grit/xwalk_resources.h", 19 | ] 20 | 21 | vars = { 22 | } 23 | 24 | deps = { 25 | } 26 | 27 | hooks = [ 28 | { 29 | # Generate .gclient-mogo for ChromeView's dependencies. 30 | "name": "generate-gclient-mogo", 31 | "pattern": ".", 32 | "action": ["python", "src/chromeview/tools/generate_gclient-mogo.py"], 33 | }, 34 | { 35 | # Fetch ChromeView dependencies. 36 | "name": "fetch-deps", 37 | "pattern": ".", 38 | "action": ["python", "src/chromeview/tools/fetch_deps.py", "-v"], 39 | }, 40 | #{ 41 | # # Apply patches. 42 | # "name": "patcher", 43 | # "pattern": ".", 44 | # "action": ["python", "src/chromeview/tools/patcher.py", "--patch-config", "src/chromeview/patch/patch.cfg"], 45 | #}, 46 | #{ 47 | # # A change to a .gyp, .gypi, or to GYP itself should run the generator. 48 | # "name": "gyp-mogo", 49 | # "pattern": ".", 50 | # "action": ["python", "src/chromeview/gyp_mogo"], 51 | #} 52 | ] -------------------------------------------------------------------------------- /DEPS.mogo: -------------------------------------------------------------------------------- 1 | ''' This file indicate the dependencies ChromeView lays on. 2 | DO NOT use this DEPS to checkout code, it's for tools/generate_gclient-mogo.py. 3 | ''' 4 | 5 | # chromium_branch is the version of chromium ChromeView based. 6 | # Use 'Trunk' for trunk. 7 | # If using trunk, will use '.DEPS.git' for gclient. 8 | chromium_branch = '1847' 9 | chromium_crosswalk_point = '8fcd11b712d73ff5332d9e397cb430ce7ba21d21' 10 | blink_crosswalk_point = '729e2d7bb71af2e0ed323ad6850806547bdb2bb3' 11 | deps_mogo = { 12 | 'src': 'https://github.com/mogoweb/chromium-crosswalk.git@%s' % chromium_crosswalk_point, 13 | 'src/third_party/WebKit': 'https://github.com/mogoweb/blink-crosswalk.git@%s' % blink_crosswalk_point, 14 | } 15 | vars_mogo = { 16 | } 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 mogoweb. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /build/adb_gdb_chromeview_shell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2013 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | # 7 | # Attach to or start a ContentShell process and debug it. 8 | # See --help for details. 9 | # 10 | PROGDIR=$(dirname "$0") 11 | export ADB_GDB_PROGNAME=$(basename "$0") 12 | export ADB_GDB_ACTIVITY=.ShellActivity 13 | "$PROGDIR"/../../build/android/adb_gdb \ 14 | --program-name=WebViewShell \ 15 | --package-name=com.mogoweb.chrome.shell \ 16 | "$@" 17 | -------------------------------------------------------------------------------- /build/envsetup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014 mogoweb. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | SCRIPT_DIR="$(dirname "${BASH_SOURCE:-$0}")" 8 | 9 | . ${SCRIPT_DIR}/../../build/android/envsetup.sh "$@" 10 | 11 | HOST_OS=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') 12 | ANDROID_HOST_ARCH=$(uname -m) 13 | export PATH=$PATH:${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.6/prebuilt/${HOST_OS}-${ANDROID_HOST_ARCH}/bin 14 | export PATH=$PATH:${CHROME_SRC}/chromeview/tools:${CHROME_SRC}/chromeview/build 15 | 16 | export CHROMIUM_GYP_FILE=${CHROME_SRC}/chromeview/chromeview.gyp 17 | 18 | mogo_gyp() { 19 | echo "GYP_GENERATORS set to '$GYP_GENERATORS'" 20 | ( 21 | "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /chromeview.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014 mogoweb. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | { 5 | 'variables': { 6 | # A hook that can be overridden in other repositories to add additional 7 | # compilation targets to 'All' 8 | 'android_app_targets%': [], 9 | 'chromium_code': 1, 10 | }, 11 | 'targets': [ 12 | { 13 | 'target_name': 'All', 14 | 'type': 'none', 15 | 'dependencies': [ 16 | 'libchromeview', 17 | ], 18 | }, 19 | { 20 | 'target_name': 'libchromeview', 21 | 'type': 'shared_library', 22 | 'android_unmangled_name': 1, 23 | 'dependencies': [ 24 | '../android_webview/android_webview.gyp:android_webview_common', 25 | ], 26 | 'sources': [ 27 | 'native/jni_entry_point.cpp', 28 | 'native/draw_gl_functor.cpp', 29 | ], 30 | 'include_dirs': [ 31 | './native', 32 | ], 33 | 'cflags!': [ 34 | '-Werror', 35 | ], 36 | }, 37 | ], 38 | } 39 | -------------------------------------------------------------------------------- /java/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /java/assets/webviewchromium.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/assets/webviewchromium.pak -------------------------------------------------------------------------------- /java/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/libs/android-support-v4.jar -------------------------------------------------------------------------------- /java/libs/armeabi-v7a/gdbserver: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/libs/armeabi-v7a/gdbserver -------------------------------------------------------------------------------- /java/libs/armeabi-v7a/libchromeview.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/libs/armeabi-v7a/libchromeview.so -------------------------------------------------------------------------------- /java/libs/guava_javalib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/libs/guava_javalib.jar -------------------------------------------------------------------------------- /java/libs/jsr_305_javalib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/libs/jsr_305_javalib.jar -------------------------------------------------------------------------------- /java/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /java/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library=true 16 | -------------------------------------------------------------------------------- /java/res/drawable-hdpi/autofill_popup_background_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/autofill_popup_background_down.9.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/autofill_popup_background_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/autofill_popup_background_up.9.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/bubble.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/bubble.9.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/bubble_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/bubble_arrow_up.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/color_picker_advanced_select_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/color_picker_advanced_select_handle.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ic_find_next_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ic_find_next_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ic_find_previous_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ic_find_previous_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ic_media_video_poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ic_media_video_poster.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ic_menu_search_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ic_menu_search_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ic_menu_share_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ic_menu_share_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/ondemand_overlay.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/ondemand_overlay.9.png -------------------------------------------------------------------------------- /java/res/drawable-hdpi/pageinfo_warning_major.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-hdpi/pageinfo_warning_major.png -------------------------------------------------------------------------------- /java/res/drawable-ldpi/ic_media_video_poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-ldpi/ic_media_video_poster.png -------------------------------------------------------------------------------- /java/res/drawable-mdpi/ic_find_next_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-mdpi/ic_find_next_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-mdpi/ic_find_previous_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-mdpi/ic_find_previous_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /java/res/drawable-mdpi/ic_media_video_poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-mdpi/ic_media_video_poster.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/autofill_popup_background_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/autofill_popup_background_down.9.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/autofill_popup_background_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/autofill_popup_background_up.9.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/bubble.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/bubble.9.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/bubble_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/bubble_arrow_up.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/color_picker_advanced_select_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/color_picker_advanced_select_handle.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ic_find_next_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ic_find_next_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ic_find_previous_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ic_find_previous_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ic_media_video_poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ic_media_video_poster.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ic_menu_search_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ic_menu_search_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ic_menu_share_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ic_menu_share_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/ondemand_overlay.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/ondemand_overlay.9.png -------------------------------------------------------------------------------- /java/res/drawable-xhdpi/pageinfo_warning_major.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable-xhdpi/pageinfo_warning_major.png -------------------------------------------------------------------------------- /java/res/drawable/autofill_popup_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /java/res/drawable/autofill_popup_background_down.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/autofill_popup_background_down.9.png -------------------------------------------------------------------------------- /java/res/drawable/autofill_popup_background_up.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/autofill_popup_background_up.9.png -------------------------------------------------------------------------------- /java/res/drawable/bubble.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/bubble.9.png -------------------------------------------------------------------------------- /java/res/drawable/bubble_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/bubble_arrow_up.png -------------------------------------------------------------------------------- /java/res/drawable/color_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /java/res/drawable/color_picker_advanced_select_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/color_picker_advanced_select_handle.png -------------------------------------------------------------------------------- /java/res/drawable/color_picker_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /java/res/drawable/ic_menu_search_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/ic_menu_search_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable/ic_menu_share_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/ic_menu_share_holo_light.png -------------------------------------------------------------------------------- /java/res/drawable/ondemand_overlay.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/ondemand_overlay.9.png -------------------------------------------------------------------------------- /java/res/drawable/pageinfo_warning_major.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/drawable/pageinfo_warning_major.png -------------------------------------------------------------------------------- /java/res/layout-land/date_time_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 24 | 25 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /java/res/layout/autofill_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 22 | 32 | 33 | -------------------------------------------------------------------------------- /java/res/layout/color_picker_dialog_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 25 | 26 | 33 | 34 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /java/res/layout/date_time_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 24 | 25 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /java/res/layout/date_time_suggestion.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 24 | 35 | 36 | -------------------------------------------------------------------------------- /java/res/layout/js_prompt.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 21 | 22 | 28 | 29 | 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /java/res/layout/webview_find.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 22 | 32 | 39 | 40 | -------------------------------------------------------------------------------- /java/res/menu/webview_find.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /java/res/mipmap-hdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/mipmap-hdpi/app_icon.png -------------------------------------------------------------------------------- /java/res/mipmap-mdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/mipmap-mdpi/app_icon.png -------------------------------------------------------------------------------- /java/res/mipmap-xhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/mipmap-xhdpi/app_icon.png -------------------------------------------------------------------------------- /java/res/mipmap-xxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/java/res/mipmap-xxhdpi/app_icon.png -------------------------------------------------------------------------------- /java/res/raw-zh-rCN/loaderror.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 找不到网页 5 | 9 | 10 | 11 | 12 | 13 |

找不到网页

14 |

%s 处的网页不能载入,原因为:

15 | 16 |

%e

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /java/res/raw-zh-rCN/nodomain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 找不到网页 5 | 9 | 10 | 11 | 12 | 13 |

找不到网页

14 |

%s 处的网页可能暂时出现故障,也可能已永久移至某个新的网络地址。

15 | 16 |

以下是几点建议:

17 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /java/res/raw/loaderror.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Webpage not available 5 | 9 | 10 | 11 | 12 | 13 |

Webpage not available

14 |

The webpage at %s could not be loaded because:

15 | 16 |

%e

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /java/res/raw/nodomain.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Webpage not available 5 | 9 | 10 | 11 | 12 | 13 |

Webpage not available

14 |

The webpage at %s might be 15 | temporarily down or it may have moved permanently to a new web 16 | address.

17 | 18 |

Suggestions:

19 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /java/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /java/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /java/res/values-v17/styles_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /java/res/values-v17/styles_ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 13 | -------------------------------------------------------------------------------- /java/res/values-zh-rCN/android_ui_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | "内存不足,无法完成上一操作" 4 | "无法打开所选文件" 5 | "更多" 6 | "色调" 7 | "饱和度" 8 | "值" 9 | "设置" 10 | "取消" 11 | "选择颜色" 12 | "红色" 13 | "青色" 14 | "蓝色" 15 | "绿色" 16 | "洋红色" 17 | "黄色" 18 | "黑色" 19 | "白色" 20 | "未能复制到剪贴板" 21 | 22 | -------------------------------------------------------------------------------- /java/res/values/android_ui_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | "Unable to complete previous operation due to low memory" 4 | "Failed to open selected file" 5 | "More" 6 | "Hue" 7 | "Saturation" 8 | "Value" 9 | "Set" 10 | "Cancel" 11 | "Select color" 12 | "Red" 13 | "Cyan" 14 | "Blue" 15 | "Green" 16 | "Magenta" 17 | "Yellow" 18 | "Black" 19 | "White" 20 | "Failed to copy to the clipboard" 21 | 22 | -------------------------------------------------------------------------------- /java/res/values/attrs_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /java/res/values/colors_ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | #B0B0B0 9 | #FFFFFF 10 | #E5E5E5 11 | #C0C0C0 12 | 13 | 14 | -------------------------------------------------------------------------------- /java/res/values/dimens_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 7dp 11 | 12 | -------------------------------------------------------------------------------- /java/res/values/dimens_ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 13 | 14.5dp 14 | 60dp 15 | 44dp 16 | 1px 17 | 18 | 19 | -------------------------------------------------------------------------------- /java/res/values/strings_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /java/res/values/strings_ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /java/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /java/res/values/values_ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /java/src/OWNERS: -------------------------------------------------------------------------------- 1 | # Changes in this folder are guaranteed to affect the downstream 2 | # android_webview build. Adding one of the folks from the below list to the 3 | # review gives us time to prepare a matching change ahead of time so that our 4 | # downstream build can continue running smoothly. 5 | set noparent 6 | 7 | benm@chromium.org 8 | boliu@chomium.org 9 | michaelbai@chromium.org 10 | mkosiba@chromium.org 11 | mnaganov@chromium.org 12 | primiano@chromium.org 13 | sgurun@chromium.org 14 | torne@chromium.org 15 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/display/BrailleDisplayProperties.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.display; 18 | 19 | parcelable BrailleDisplayProperties; 20 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/display/BrailleInputEvent.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.display; 18 | 19 | parcelable BrailleInputEvent; 20 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/display/IBrailleService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.display; 18 | 19 | import com.googlecode.eyesfree.braille.display.IBrailleServiceCallback; 20 | 21 | /** 22 | * Interface for clients to talk to the braille display service. 23 | */ 24 | interface IBrailleService { 25 | /** 26 | * Register a callback for the {@code callingApp} which will receive 27 | * certain braille display related events. 28 | */ 29 | boolean registerCallback(in IBrailleServiceCallback callback); 30 | 31 | /** 32 | * Unregister a previously registered callback for the {@code callingApp}. 33 | */ 34 | oneway void unregisterCallback(in IBrailleServiceCallback callback); 35 | 36 | /** 37 | * Updates the main cells of the connected braille display 38 | * with a given dot {@code pattern}. 39 | * 40 | * @return {@code true} on success and {@code false} otherwise. 41 | */ 42 | void displayDots(in byte[] patterns); 43 | } 44 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/display/IBrailleServiceCallback.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.display; 18 | 19 | import com.googlecode.eyesfree.braille.display.BrailleDisplayProperties; 20 | import com.googlecode.eyesfree.braille.display.BrailleInputEvent; 21 | 22 | /** 23 | * Callback interface that a braille display client can expose to 24 | * get information about various braille display events. 25 | */ 26 | interface IBrailleServiceCallback { 27 | void onDisplayConnected(in BrailleDisplayProperties displayProperties); 28 | void onDisplayDisconnected(); 29 | void onInput(in BrailleInputEvent inputEvent); 30 | } 31 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.selfbraille; 18 | 19 | import com.googlecode.eyesfree.braille.selfbraille.WriteData; 20 | 21 | /** 22 | * Interface for a client to control braille output for a part of the 23 | * accessibility node tree. 24 | */ 25 | interface ISelfBrailleService { 26 | void write(IBinder clientToken, in WriteData writeData); 27 | oneway void disconnect(IBinder clientToken); 28 | } 29 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/selfbraille/WriteData.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.selfbraille; 18 | 19 | parcelable WriteData; 20 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/translate/BrailleTranslator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.translate; 18 | 19 | /** 20 | * Translates from text to braille and the other way according to a 21 | * particular translation table. 22 | */ 23 | public interface BrailleTranslator { 24 | /** 25 | * Translates a string into the corresponding dot patterns and returns the 26 | * resulting byte array. Returns {@code null} on error. 27 | */ 28 | byte[] translate(String text); 29 | 30 | /** 31 | * Translates the braille {@code cells} into the corresponding text, which 32 | * is returned. Returns {@code null} on error. 33 | */ 34 | String backTranslate(byte[] cells); 35 | } 36 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/translate/ITranslatorService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.translate; 18 | 19 | import com.googlecode.eyesfree.braille.translate.ITranslatorServiceCallback; 20 | 21 | interface ITranslatorService { 22 | /** 23 | * Sets a callback to be called when the service is ready to translate. 24 | * Using any of the other methods in this interface before the 25 | * callback is called with a successful status will return 26 | * failure. 27 | */ 28 | void setCallback(ITranslatorServiceCallback callback); 29 | 30 | /** 31 | * Makes sure that the given table string is valid and that the 32 | * table compiles. 33 | */ 34 | boolean checkTable(String tableName); 35 | 36 | /** 37 | * Translates text into braille according to the give tableName. 38 | * Returns null on fatal translation errors. 39 | */ 40 | byte[] translate(String text, String tableName); 41 | 42 | /** 43 | * Translates braille cells into text according to the given table 44 | * name. Returns null on fatal translation errors. 45 | */ 46 | String backTranslate(in byte[] cells, String tableName); 47 | } 48 | -------------------------------------------------------------------------------- /java/src/com/googlecode/eyesfree/braille/translate/ITranslatorServiceCallback.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package com.googlecode.eyesfree.braille.translate; 18 | 19 | oneway interface ITranslatorServiceCallback { 20 | void onInit(int status); 21 | } 22 | -------------------------------------------------------------------------------- /java/src/com/mogoweb/chrome/DownloadListener.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 mogoweb. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | /* 6 | * Copyright (C) 2007 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package com.mogoweb.chrome; 21 | 22 | public interface DownloadListener { 23 | 24 | /** 25 | * Notify the host application that a file should be downloaded 26 | * @param url The full url to the content that should be downloaded 27 | * @param userAgent the user agent to be used for the download. 28 | * @param contentDisposition Content-disposition http header, if 29 | * present. 30 | * @param mimetype The mimetype of the content reported by the server 31 | * @param contentLength The file size reported by the server 32 | */ 33 | public void onDownloadStart(String url, String userAgent, 34 | String contentDisposition, String mimetype, long contentLength); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /java/src/com/mogoweb/chrome/JavascriptInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mogoweb.chrome; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Annotation that allows exposing methods to JavaScript. Starting from API level 26 | * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} and above, only methods explicitly 27 | * marked with this annotation are available to the Javascript code. See 28 | * {@link android.webkit.WebView#addJavascriptInterface} for more information about it. 29 | * 30 | */ 31 | @SuppressWarnings("javadoc") 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target({ElementType.METHOD}) 34 | public @interface JavascriptInterface { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /java/src/com/mogoweb/chrome/MustOverrideException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.mogoweb.chrome; 18 | 19 | //TODO: Remove MustOverrideException and make all methods throwing it abstract instead; 20 | //needs API file update. 21 | public class MustOverrideException extends RuntimeException { 22 | MustOverrideException() { 23 | super("abstract function called: must be overriden!"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java/src/com/mogoweb/chrome/SslErrorHandler.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 mogoweb. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | /* 5 | * Copyright (C) 2007 The Android Open Source Project 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package com.mogoweb.chrome; 21 | 22 | import android.os.Handler; 23 | 24 | /** 25 | * Represents a request for handling an SSL error. Instances of this class are 26 | * created by the WebView and passed to 27 | * {@link WebViewClient#onReceivedSslError}. The host application must call 28 | * either {@link #proceed} or {@link #cancel} to set the WebView's response 29 | * to the request. 30 | */ 31 | public class SslErrorHandler extends Handler { 32 | 33 | /** 34 | * @hide Only for use by WebViewProvider implementations. 35 | */ 36 | public SslErrorHandler() {} 37 | 38 | /** 39 | * Proceed with the SSL certificate. 40 | */ 41 | public void proceed() {} 42 | 43 | /** 44 | * Cancel this request and all pending requests for the WebView that had 45 | * the error. 46 | */ 47 | public void cancel() {} 48 | } 49 | -------------------------------------------------------------------------------- /java/src/com/mogoweb/chrome/impl/DebugFlags.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 mogoweb. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | /* 5 | * Copyright (C) 2009 The Android Open Source Project 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package com.mogoweb.chrome.impl; 21 | 22 | /** 23 | * This class is a container for all of the debug flags used in the Java 24 | * components of webkit. These flags must be final in order to ensure that 25 | * the compiler optimizes the code that uses them out of the final executable. 26 | * 27 | * The name of each flags maps directly to the name of the class in which that 28 | * flag is used. 29 | * 30 | * @hide Only used by WebView implementations. 31 | */ 32 | public class DebugFlags { 33 | 34 | public static final boolean COOKIE_SYNC_MANAGER = false; 35 | public static final boolean TRACE_API = false; 36 | public static final boolean TRACE_CALLBACK = false; 37 | public static final boolean TRACE_JAVASCRIPT_BRIDGE = false; 38 | public static final boolean URL_UTIL = false; 39 | public static final boolean WEB_SYNC_MANAGER = false; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/AwContentsIoThreadClient.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import org.chromium.base.CalledByNative; 8 | import org.chromium.base.JNINamespace; 9 | 10 | /** 11 | * Delegate for handling callbacks. All methods are called on the IO thread. 12 | * 13 | * You should create a separate instance for every WebContents that requires the 14 | * provided functionality. 15 | */ 16 | @JNINamespace("android_webview") 17 | public interface AwContentsIoThreadClient { 18 | @CalledByNative 19 | public int getCacheMode(); 20 | 21 | @CalledByNative 22 | public InterceptedRequestData shouldInterceptRequest(String url, boolean isMainFrame); 23 | 24 | @CalledByNative 25 | public boolean shouldBlockContentUrls(); 26 | 27 | @CalledByNative 28 | public boolean shouldBlockFileUrls(); 29 | 30 | @CalledByNative 31 | public boolean shouldBlockNetworkLoads(); 32 | 33 | @CalledByNative 34 | public void onDownloadStart(String url, 35 | String userAgent, 36 | String contentDisposition, 37 | String mimeType, 38 | long contentLength); 39 | 40 | @CalledByNative 41 | public void newLoginRequest(String realm, String account, String args); 42 | } 43 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/AwDevToolsServer.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import org.chromium.base.JNINamespace; 8 | 9 | /** 10 | * Controller for Remote Web Debugging (Developer Tools). 11 | */ 12 | @JNINamespace("android_webview") 13 | public class AwDevToolsServer { 14 | 15 | private int mNativeDevToolsServer = 0; 16 | 17 | public AwDevToolsServer() { 18 | mNativeDevToolsServer = nativeInitRemoteDebugging(); 19 | } 20 | 21 | public void destroy() { 22 | nativeDestroyRemoteDebugging(mNativeDevToolsServer); 23 | mNativeDevToolsServer = 0; 24 | } 25 | 26 | public void setRemoteDebuggingEnabled(boolean enabled) { 27 | nativeSetRemoteDebuggingEnabled(mNativeDevToolsServer, enabled); 28 | } 29 | 30 | private native int nativeInitRemoteDebugging(); 31 | private native void nativeDestroyRemoteDebugging(int devToolsServer); 32 | private native void nativeSetRemoteDebuggingEnabled(int devToolsServer, boolean enabled); 33 | } 34 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/AwFormDatabase.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import org.chromium.base.JNINamespace; 8 | 9 | /** 10 | * Exposes a subset of Chromium form database to Webview database for managing autocomplete 11 | * functionality. 12 | */ 13 | @JNINamespace("android_webview") 14 | public class AwFormDatabase { 15 | 16 | public static boolean hasFormData() { 17 | return nativeHasFormData(); 18 | } 19 | 20 | public static void clearFormData() { 21 | nativeClearFormData(); 22 | } 23 | 24 | //-------------------------------------------------------------------------------------------- 25 | // Native methods 26 | //-------------------------------------------------------------------------------------------- 27 | private static native boolean nativeHasFormData(); 28 | 29 | private static native void nativeClearFormData(); 30 | } 31 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/AwHttpAuthHandler.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import org.chromium.base.CalledByNative; 8 | import org.chromium.base.JNINamespace; 9 | 10 | @JNINamespace("android_webview") 11 | public class AwHttpAuthHandler { 12 | 13 | private long mNativeAwHttpAuthHandler; 14 | private final boolean mFirstAttempt; 15 | 16 | public void proceed(String username, String password) { 17 | if (mNativeAwHttpAuthHandler != 0) { 18 | nativeProceed(mNativeAwHttpAuthHandler, username, password); 19 | mNativeAwHttpAuthHandler = 0; 20 | } 21 | } 22 | 23 | public void cancel() { 24 | if (mNativeAwHttpAuthHandler != 0) { 25 | nativeCancel(mNativeAwHttpAuthHandler); 26 | mNativeAwHttpAuthHandler = 0; 27 | } 28 | } 29 | 30 | public boolean isFirstAttempt() { 31 | return mFirstAttempt; 32 | } 33 | 34 | @CalledByNative 35 | public static AwHttpAuthHandler create(long nativeAwAuthHandler, boolean firstAttempt) { 36 | return new AwHttpAuthHandler(nativeAwAuthHandler, firstAttempt); 37 | } 38 | 39 | private AwHttpAuthHandler(long nativeAwHttpAuthHandler, boolean firstAttempt) { 40 | mNativeAwHttpAuthHandler = nativeAwHttpAuthHandler; 41 | mFirstAttempt = firstAttempt; 42 | } 43 | 44 | @CalledByNative 45 | void handlerDestroyed() { 46 | mNativeAwHttpAuthHandler = 0; 47 | } 48 | 49 | private native void nativeProceed(long nativeAwHttpAuthHandler, 50 | String username, String password); 51 | private native void nativeCancel(long nativeAwHttpAuthHandler); 52 | } 53 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/AwWebContentsDelegate.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import com.google.common.annotations.VisibleForTesting; 8 | 9 | import org.chromium.base.CalledByNative; 10 | import org.chromium.base.JNINamespace; 11 | import org.chromium.components.web_contents_delegate_android.WebContentsDelegateAndroid; 12 | 13 | /** 14 | * WebView-specific WebContentsDelegate. 15 | * This file is the Java version of the native class of the same name. 16 | * It should contain abstract WebContentsDelegate methods to be implemented by the embedder. 17 | * These methods belong to WebView but are not shared with the Chromium Android port. 18 | */ 19 | @VisibleForTesting 20 | @JNINamespace("android_webview") 21 | public abstract class AwWebContentsDelegate extends WebContentsDelegateAndroid { 22 | // Callback filesSelectedInChooser() when done. 23 | @CalledByNative 24 | public abstract void runFileChooser(int processId, int renderId, int mode_flags, 25 | String acceptTypes, String title, String defaultFilename, boolean capture); 26 | 27 | @CalledByNative 28 | public abstract boolean addNewContents(boolean isDialog, boolean isUserGesture); 29 | 30 | @Override 31 | @CalledByNative 32 | public abstract void closeContents(); 33 | 34 | @Override 35 | @CalledByNative 36 | public abstract void activateContents(); 37 | 38 | // Call in response to a prior runFileChooser call. 39 | protected static native void nativeFilesSelectedInChooser(int processId, int renderId, 40 | int mode_flags, String[] filePath); 41 | } 42 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/InterceptedRequestData.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import org.chromium.base.CalledByNative; 8 | import org.chromium.base.JNINamespace; 9 | 10 | import java.io.InputStream; 11 | 12 | /** 13 | * The response information that is to be returned for a particular resource fetch. 14 | */ 15 | @JNINamespace("android_webview") 16 | public class InterceptedRequestData { 17 | private String mMimeType; 18 | private String mCharset; 19 | private InputStream mData; 20 | 21 | public InterceptedRequestData(String mimeType, String encoding, InputStream data) { 22 | mMimeType = mimeType; 23 | mCharset = encoding; 24 | mData = data; 25 | } 26 | 27 | @CalledByNative 28 | public String getMimeType() { 29 | return mMimeType; 30 | } 31 | 32 | @CalledByNative 33 | public String getCharset() { 34 | return mCharset; 35 | } 36 | 37 | @CalledByNative 38 | public InputStream getData() { 39 | return mData; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/JsPromptResultReceiver.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | /** 8 | * This interface is used when the AwContentsClient offers a JavaScript 9 | * modal prompt dialog to enable the client to handle the dialog in their own way. 10 | * AwContentsClient will offer an object that implements this interface to the 11 | * client and when the client has handled the dialog, it must either callback with 12 | * confirm() or cancel() to allow processing to continue. 13 | */ 14 | public interface JsPromptResultReceiver { 15 | public void confirm(String result); 16 | public void cancel(); 17 | } 18 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/JsResultHandler.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | import org.chromium.base.ThreadUtils; 8 | 9 | class JsResultHandler implements JsResultReceiver, JsPromptResultReceiver { 10 | private AwContentsClientBridge mBridge; 11 | private final int mId; 12 | 13 | JsResultHandler(AwContentsClientBridge bridge, int id) { 14 | mBridge = bridge; 15 | mId = id; 16 | } 17 | 18 | @Override 19 | public void confirm() { 20 | confirm(null); 21 | } 22 | 23 | @Override 24 | public void confirm(final String promptResult) { 25 | ThreadUtils.runOnUiThread(new Runnable() { 26 | @Override 27 | public void run() { 28 | if (mBridge != null) 29 | mBridge.confirmJsResult(mId, promptResult); 30 | mBridge = null; 31 | } 32 | }); 33 | } 34 | 35 | @Override 36 | public void cancel() { 37 | ThreadUtils.runOnUiThread(new Runnable() { 38 | @Override 39 | public void run() { 40 | if (mBridge != null) 41 | mBridge.cancelJsResult(mId); 42 | mBridge = null; 43 | } 44 | }); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /java/src/org/chromium/android_webview/JsResultReceiver.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.android_webview; 6 | 7 | /** 8 | * This interface is used when the AwContentsClient offers a JavaScript 9 | * modal dialog (alert, beforeunload or confirm) to enable the client to 10 | * handle the dialog in their own way. AwContentsClient will offer an object 11 | * that implements this interface to the client and when the client has handled 12 | * the dialog, it must either callback with confirm() or cancel() to allow 13 | * processing to continue. 14 | */ 15 | public interface JsResultReceiver { 16 | public void confirm(); 17 | public void cancel(); 18 | } 19 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/AccessedByNative.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * @AccessedByNative is used to ensure proguard will keep this field, since it's 14 | * only accessed by native. 15 | */ 16 | @Target(ElementType.FIELD) 17 | @Retention(RetentionPolicy.CLASS) 18 | public @interface AccessedByNative { 19 | public String value() default ""; 20 | } 21 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/ActivityState.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.base; 6 | 7 | 8 | 9 | 10 | interface ActivityState { 11 | public final int CREATED = 1; 12 | public final int STARTED = 2; 13 | public final int RESUMED = 3; 14 | public final int PAUSED = 4; 15 | public final int STOPPED = 5; 16 | public final int DESTROYED = 6; 17 | } 18 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/ActivityState.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | // A simple auto-generated interface used to list the various 8 | // states of an activity as used by both org.chromium.base.ActivityStatus 9 | // and base/android/activity_status.h 10 | interface ActivityState { 11 | #define DEFINE_ACTIVITY_STATE(x,y) public final int x = y; 12 | #include "base/android/activity_state_list.h" 13 | #undef DEFINE_ACTIVITY_STATE 14 | } 15 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/BaseChromiumApplication.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import android.app.Application; 8 | 9 | /** 10 | * Basic application functionality that should be shared among all browser applications. 11 | */ 12 | public class BaseChromiumApplication extends Application { 13 | 14 | @Override 15 | public void onCreate() { 16 | super.onCreate(); 17 | ActivityStatus.initialize(this); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/BaseSwitches.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | /** 8 | * Contains all of the command line switches that are specific to the base/ 9 | * portion of Chromium on Android. 10 | */ 11 | public abstract class BaseSwitches { 12 | // Block onCreate() of Chrome until a Java debugger is attached. 13 | public static final String WAIT_FOR_JAVA_DEBUGGER = "wait-for-java-debugger"; 14 | 15 | // Overrides low-end device detection, disabling low-end device optimizations. 16 | public static final String DISABLE_LOW_END_DEVICE_MODE = "disable-low-end-device-mode"; 17 | 18 | // Overrides low-end device detection, enabling low-end device optimizations. 19 | public static final String ENABLE_LOW_END_DEVICE_MODE = "enable-low-end-device-mode"; 20 | 21 | // Adds additional thread idle time information into the trace event output. 22 | public static final String ENABLE_IDLE_TRACING = "enable-idle-tracing"; 23 | 24 | // Prevent instantiation. 25 | private BaseSwitches() {} 26 | } 27 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/CalledByNative.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * @CalledByNative is used by the JNI generator to create the necessary JNI 14 | * bindings and expose this method to native code. 15 | */ 16 | @Target(ElementType.METHOD) 17 | @Retention(RetentionPolicy.CLASS) 18 | public @interface CalledByNative { 19 | /* 20 | * If present, tells which inner class the method belongs to. 21 | */ 22 | public String value() default ""; 23 | } 24 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/CalledByNativeUnchecked.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * @CalledByNativeUnchecked is used to generate JNI bindings that do not check for exceptions. 14 | * It only makes sense to use this annotation on methods that declare a throws... spec. 15 | * However, note that the exception received native side maybe an 'unchecked' (RuntimeExpception) 16 | * such as NullPointerException, so the native code should differentiate these cases. 17 | * Usage of this should be very rare; where possible handle exceptions in the Java side and use a 18 | * return value to indicate success / failure. 19 | */ 20 | @Target(ElementType.METHOD) 21 | @Retention(RetentionPolicy.CLASS) 22 | public @interface CalledByNativeUnchecked { 23 | /* 24 | * If present, tells which inner class the method belongs to. 25 | */ 26 | public String value() default ""; 27 | } 28 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/ChromiumApplication.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import android.app.Application; 8 | 9 | /** 10 | * Basic application functionality that should be shared among all browser applications. 11 | */ 12 | public class ChromiumApplication extends Application { 13 | 14 | @Override 15 | public void onCreate() { 16 | super.onCreate(); 17 | ActivityStatus.initialize(this); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/CollectionUtil.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import java.util.ArrayList; 8 | import java.util.Collections; 9 | import java.util.HashSet; 10 | 11 | /** 12 | * Functions used for easier initialization of Java collections. Inspired by 13 | * functionality in com.google.common.collect in Guava but cherry-picked to 14 | * bare-minimum functionality to avoid bloat. (http://crbug.com/272790 provides 15 | * further details) 16 | */ 17 | public final class CollectionUtil { 18 | private CollectionUtil() {} 19 | 20 | public static HashSet newHashSet(E... elements) { 21 | HashSet set = new HashSet(elements.length); 22 | Collections.addAll(set, elements); 23 | return set; 24 | } 25 | 26 | public static ArrayList newArrayList(E... elements) { 27 | ArrayList list = new ArrayList(elements.length); 28 | Collections.addAll(list, elements); 29 | return list; 30 | } 31 | 32 | public static ArrayList newArrayList(Iterable iterable) { 33 | ArrayList list = new ArrayList(); 34 | for (E element : iterable) { 35 | list.add(element); 36 | } 37 | return list; 38 | } 39 | } -------------------------------------------------------------------------------- /java/src/org/chromium/base/CpuFeatures.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | // The only purpose of this class is to allow sending CPU properties 8 | // from the browser process to sandboxed renderer processes. This is 9 | // needed because sandboxed processes cannot, on ARM, query the kernel 10 | // about the CPU's properties by parsing /proc, so this operation must 11 | // be performed in the browser process, and the result passed to 12 | // renderer ones. 13 | // 14 | // For more context, see http://crbug.com/164154 15 | // 16 | // Technically, this is a wrapper around the native NDK cpufeatures 17 | // library. The exact CPU features bits are never used in Java so 18 | // there is no point in duplicating their definitions here. 19 | // 20 | @JNINamespace("base::android") 21 | public abstract class CpuFeatures { 22 | /** 23 | * Return the number of CPU Cores on the device. 24 | */ 25 | public static int getCount() { 26 | return nativeGetCoreCount(); 27 | } 28 | 29 | /** 30 | * Return the CPU feature mask. 31 | * This is a 64-bit integer that corresponds to the CPU's features. 32 | * The value comes directly from android_getCpuFeatures(). 33 | */ 34 | public static long getMask() { 35 | return nativeGetCpuFeatures(); 36 | } 37 | 38 | private static native int nativeGetCoreCount(); 39 | private static native long nativeGetCpuFeatures(); 40 | } 41 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/ImportantFileWriterAndroid.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | /** 8 | * This class provides an interface to the native class for writing 9 | * important data files without risking data loss. 10 | */ 11 | @JNINamespace("base::android") 12 | public class ImportantFileWriterAndroid { 13 | 14 | /** 15 | * Write a binary file atomically. 16 | * 17 | * This either writes all the data or leaves the file unchanged. 18 | * 19 | * @param fileName The complete path of the file to be written 20 | * @param data The data to be written to the file 21 | * @return true if the data was written to the file, false if not. 22 | */ 23 | public static boolean writeFileAtomically(String fileName, byte[] data) { 24 | return nativeWriteFileAtomically(fileName, data); 25 | } 26 | 27 | private static native boolean nativeWriteFileAtomically( 28 | String fileName, byte[] data); 29 | } 30 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/JNINamespace.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * @JNINamespace is used by the JNI generator to create the necessary JNI 14 | * bindings and expose this method to native code using the specified namespace. 15 | */ 16 | @Target(ElementType.TYPE) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | public @interface JNINamespace { 19 | public String value(); 20 | } 21 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/JavaHandlerThread.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import android.os.Handler; 8 | import android.os.HandlerThread; 9 | 10 | /** 11 | * This class is an internal detail of the native counterpart. 12 | * It is instantiated and owned by the native object. 13 | */ 14 | @JNINamespace("base::android") 15 | class JavaHandlerThread { 16 | final HandlerThread mThread; 17 | 18 | private JavaHandlerThread(String name) { 19 | mThread = new HandlerThread(name); 20 | } 21 | 22 | @CalledByNative 23 | private static JavaHandlerThread create(String name) { 24 | return new JavaHandlerThread(name); 25 | } 26 | 27 | @CalledByNative 28 | private void start(final long nativeThread, final long nativeEvent) { 29 | mThread.start(); 30 | new Handler(mThread.getLooper()).post(new Runnable() { 31 | @Override 32 | public void run() { 33 | nativeInitializeThread(nativeThread, nativeEvent); 34 | } 35 | }); 36 | } 37 | 38 | private native void nativeInitializeThread(long nativeJavaHandlerThread, long nativeEvent); 39 | } 40 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/MemoryPressureLevelList.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.base; 6 | 7 | class MemoryPressureLevelList { 8 | 9 | 10 | 11 | 12 | 13 | 14 | static final int MEMORY_PRESSURE_MODERATE = 0; 15 | 16 | 17 | 18 | 19 | static final int MEMORY_PRESSURE_CRITICAL = 2; 20 | } 21 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/MemoryPressureLevelList.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | class MemoryPressureLevelList { 8 | #define DEFINE_MEMORY_PRESSURE_LEVEL(name, value) \ 9 | static final int name = value; 10 | #include "base/memory/memory_pressure_level_list.h" 11 | #undef DEFINE_MEMORY_PRESSURE_LEVEL 12 | } 13 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/NativeClassQualifiedName.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * @NativeClassQualifiedName is used by the JNI generator to create the necessary JNI 14 | * bindings to call into the specified native class name. 15 | */ 16 | @Target(ElementType.METHOD) 17 | @Retention(RetentionPolicy.RUNTIME) 18 | public @interface NativeClassQualifiedName { 19 | /* 20 | * Tells which native class the method is going to be bound to. 21 | * The first parameter of the annotated method must be an int nativePtr pointing to 22 | * an instance of this class. 23 | */ 24 | public String value(); 25 | } 26 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/PathService.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | /** 8 | * This class provides java side access to the native PathService. 9 | */ 10 | @JNINamespace("base::android") 11 | public abstract class PathService { 12 | 13 | // Must match the value of DIR_MODULE in base/base_paths.h! 14 | public static final int DIR_MODULE = 3; 15 | 16 | // Prevent instantiation. 17 | private PathService() {} 18 | 19 | public static void override(int what, String path) { 20 | nativeOverride(what, path); 21 | } 22 | 23 | private static native void nativeOverride(int what, String path); 24 | } 25 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/PowerStatusReceiver.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import android.content.BroadcastReceiver; 8 | import android.content.Context; 9 | import android.content.Intent; 10 | 11 | 12 | /** 13 | * A BroadcastReceiver that listens to changes in power status and notifies 14 | * PowerMonitor. 15 | * It's instantiated by the framework via the application intent-filter 16 | * declared in its manifest. 17 | */ 18 | public class PowerStatusReceiver extends BroadcastReceiver { 19 | @Override 20 | public void onReceive(Context context, Intent intent) { 21 | PowerMonitor.onBatteryChargingChanged(intent); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/SystemMessageHandler.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import android.os.Handler; 8 | import android.os.Message; 9 | 10 | class SystemMessageHandler extends Handler { 11 | 12 | private static final int TIMER_MESSAGE = 1; 13 | private static final int DELAYED_TIMER_MESSAGE = 2; 14 | 15 | // Native class pointer set by the constructor of the SharedClient native class. 16 | private long mMessagePumpDelegateNative = 0; 17 | 18 | private SystemMessageHandler(long messagePumpDelegateNative) { 19 | mMessagePumpDelegateNative = messagePumpDelegateNative; 20 | } 21 | 22 | @Override 23 | public void handleMessage(Message msg) { 24 | nativeDoRunLoopOnce(mMessagePumpDelegateNative); 25 | } 26 | 27 | @SuppressWarnings("unused") 28 | @CalledByNative 29 | private void setTimer() { 30 | sendEmptyMessage(TIMER_MESSAGE); 31 | } 32 | 33 | @SuppressWarnings("unused") 34 | @CalledByNative 35 | private void setDelayedTimer(long millis) { 36 | removeMessages(DELAYED_TIMER_MESSAGE); 37 | sendEmptyMessageDelayed(DELAYED_TIMER_MESSAGE, millis); 38 | } 39 | 40 | @SuppressWarnings("unused") 41 | @CalledByNative 42 | private void removeTimer() { 43 | removeMessages(TIMER_MESSAGE); 44 | } 45 | 46 | @CalledByNative 47 | private static SystemMessageHandler create(long messagePumpDelegateNative) { 48 | return new SystemMessageHandler(messagePumpDelegateNative); 49 | } 50 | 51 | private native void nativeDoRunLoopOnce(long messagePumpDelegateNative); 52 | } 53 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/WeakContext.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base; 6 | 7 | import android.content.Context; 8 | 9 | import java.lang.ref.WeakReference; 10 | import java.util.concurrent.Callable; 11 | 12 | /** 13 | * Holds a WeakReference to Context to allow it to be GC'd. 14 | * Also provides utility functions to getSystemService from the UI or any 15 | * other thread (may return null, if the Context has been nullified). 16 | */ 17 | public class WeakContext { 18 | private static WeakReference sWeakContext; 19 | 20 | public static void initializeWeakContext(final Context context) { 21 | sWeakContext = new WeakReference(context); 22 | } 23 | 24 | public static Context getContext() { 25 | return sWeakContext.get(); 26 | } 27 | 28 | // Returns a system service. May be called from any thread. 29 | // If necessary, it will send a message to the main thread to acquire the 30 | // service, and block waiting for it to complete. 31 | // May return null if context is no longer available. 32 | public static Object getSystemService(final String name) { 33 | final Context context = sWeakContext.get(); 34 | if (context == null) { 35 | return null; 36 | } 37 | if (ThreadUtils.runningOnUiThread()) { 38 | return context.getSystemService(name); 39 | } 40 | return ThreadUtils.runOnUiThreadBlockingNoException(new Callable() { 41 | @Override 42 | public Object call() { 43 | return context.getSystemService(name); 44 | } 45 | }); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/library_loader/LoaderErrors.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.library_loader; 6 | 7 | /** 8 | * These are the possible failures from the LibraryLoader 9 | */ 10 | public class LoaderErrors { 11 | public static final int LOADER_ERROR_NORMAL_COMPLETION = 0; 12 | public static final int LOADER_ERROR_FAILED_TO_REGISTER_JNI = 1; 13 | public static final int LOADER_ERROR_NATIVE_LIBRARY_LOAD_FAILED = 2; 14 | public static final int LOADER_ERROR_NATIVE_LIBRARY_WRONG_VERSION = 3; 15 | public static final int LOADER_ERROR_NATIVE_STARTUP_FAILED = 4; 16 | } 17 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/library_loader/NativeLibraries.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.base.library_loader; 6 | 7 | public class NativeLibraries { 8 | public static boolean USE_LINKER = false; 9 | public static boolean ENABLE_LINKER_TESTS = false; 10 | public static final String[] LIBRARIES 11 | = { "chromeview"} 12 | ; 13 | static String VERSION_NUMBER 14 | = "" 15 | ; 16 | } 17 | -------------------------------------------------------------------------------- /java/src/org/chromium/base/library_loader/ProcessInitException.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.library_loader; 6 | 7 | /** 8 | * The exception that is thrown when the intialization of a process was failed. 9 | */ 10 | public class ProcessInitException extends Exception { 11 | private int mErrorCode = LoaderErrors.LOADER_ERROR_NORMAL_COMPLETION; 12 | 13 | /** 14 | * @param errorCode This will be one of the LoaderErrors error codes. 15 | */ 16 | public ProcessInitException(int errorCode) { 17 | mErrorCode = errorCode; 18 | } 19 | 20 | /** 21 | * @param errorCode This will be one of the LoaderErrors error codes. 22 | * @param throwable The wrapped throwable obj. 23 | */ 24 | public ProcessInitException(int errorCode, Throwable throwable) { 25 | super(null, throwable); 26 | mErrorCode = errorCode; 27 | } 28 | 29 | /** 30 | * Return the error code. 31 | */ 32 | public int getErrorCode() { 33 | return mErrorCode; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java/src/org/chromium/chrome/browser/ResourceId.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.chrome.browser; 6 | 7 | import org.chromium.chrome.R; 8 | 9 | public class ResourceId { 10 | public static int mapToDrawableId(int enumeratedId) { 11 | int[] resourceList = { 12 | 13 | 14 | 0, 15 | 16 | 17 | R.drawable.infobar_geolocation, 18 | R.drawable.infobar_didyoumean, 19 | R.drawable.infobar_autofill, 20 | R.drawable.infobar_autologin, 21 | R.drawable.infobar_cookie, 22 | R.drawable.infobar_desktop_notifications, 23 | 24 | R.drawable.infobar_incomplete, 25 | R.drawable.infobar_camera, 26 | R.drawable.infobar_microphone, 27 | R.drawable.infobar_multiple_downloads, 28 | 29 | R.drawable.infobar_plugin_crashed, 30 | 31 | R.drawable.infobar_plugin, 32 | R.drawable.infobar_restore, 33 | R.drawable.infobar_savepassword, 34 | R.drawable.infobar_warning, 35 | R.drawable.infobar_theme, 36 | R.drawable.infobar_translate, 37 | 38 | 39 | R.drawable.controlled_setting_mandatory_large, 40 | 41 | R.drawable.pageinfo_bad, 42 | R.drawable.pageinfo_good, 43 | R.drawable.pageinfo_info, 44 | R.drawable.pageinfo_warning_major, 45 | 46 | R.drawable.pageinfo_warning_minor, 47 | }; 48 | if (enumeratedId >= 0 && enumeratedId < resourceList.length) { 49 | return resourceList[enumeratedId]; 50 | } 51 | assert false : "enumeratedId '" + enumeratedId + "' was out of range."; 52 | return R.drawable.missing; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/org/chromium/chrome/browser/sync/ModelTypeSelection.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.chrome.browser.sync; 6 | 7 | public class ModelTypeSelection { 8 | 9 | 10 | 11 | public static final int AUTOFILL = 1<<0; 12 | 13 | public static final int BOOKMARK = 1<<1; 14 | 15 | public static final int PASSWORD = 1<<2; 16 | 17 | public static final int SESSION = 1<<3; 18 | 19 | public static final int TYPED_URL = 1<<4; 20 | 21 | public static final int AUTOFILL_PROFILE = 1<<5; 22 | 23 | public static final int HISTORY_DELETE_DIRECTIVE = 1<<6; 24 | 25 | public static final int PROXY_TABS = 1<<7; 26 | 27 | public static final int FAVICON_IMAGE = 1<<8; 28 | 29 | public static final int FAVICON_TRACKING = 1<<9; 30 | 31 | public static final int NIGORI = 1<<10; 32 | 33 | public static final int DEVICE_INFO = 1<<11; 34 | 35 | public static final int EXPERIMENTS = 1<<12; 36 | } 37 | -------------------------------------------------------------------------------- /java/src/org/chromium/chrome/browser/ui/toolbar/ToolbarModelSecurityLevel.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.chrome.browser.ui.toolbar; 6 | 7 | public class ToolbarModelSecurityLevel { 8 | 9 | 10 | 11 | 12 | 13 | 14 | public static final int NONE = 0; 15 | 16 | 17 | public static final int EV_SECURE = 1; 18 | 19 | 20 | public static final int SECURE = 2; 21 | 22 | 23 | 24 | public static final int SECURITY_WARNING = 3; 25 | 26 | 27 | 28 | public static final int SECURITY_POLICY_WARNING = 4; 29 | 30 | 31 | public static final int SECURITY_ERROR = 5; 32 | 33 | public static final int NUM_SECURITY_LEVELS = 6; 34 | } 35 | -------------------------------------------------------------------------------- /java/src/org/chromium/components/navigation_interception/InterceptNavigationDelegate.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.components.navigation_interception; 6 | 7 | import org.chromium.base.CalledByNative; 8 | 9 | public interface InterceptNavigationDelegate { 10 | 11 | /** 12 | * This method is called for every top-level navigation within the associated WebContents. 13 | * The method allows the embedder to ignore navigations. This is used on Android to 'convert' 14 | * certain navigations to Intents to 3rd party applications. 15 | * 16 | * @param navigationParams parameters describing the navigation. 17 | * @return true if the navigation should be ignored. 18 | */ 19 | @CalledByNative 20 | boolean shouldIgnoreNavigation(NavigationParams navigationParams); 21 | } 22 | -------------------------------------------------------------------------------- /java/src/org/chromium/components/navigation_interception/NavigationParams.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.components.navigation_interception; 6 | 7 | import org.chromium.base.CalledByNative; 8 | 9 | public class NavigationParams { 10 | // Target url of the navigation. 11 | public final String url; 12 | // True if the the navigation method is "POST". 13 | public final boolean isPost; 14 | // True if the navigation was initiated by the user. 15 | public final boolean hasUserGesture; 16 | // Page transition type (e.g. link / typed). 17 | public final int pageTransitionType; 18 | // Is the navigation a redirect (in which case url is the "target" address). 19 | public final boolean isRedirect; 20 | 21 | public NavigationParams(String url, boolean isPost, boolean hasUserGesture, 22 | int pageTransitionType, boolean isRedirect) { 23 | this.url = url; 24 | this.isPost = isPost; 25 | this.hasUserGesture = hasUserGesture; 26 | this.pageTransitionType = pageTransitionType; 27 | this.isRedirect = isRedirect; 28 | } 29 | 30 | @CalledByNative 31 | public static NavigationParams create(String url, boolean isPost, boolean hasUserGesture, 32 | int pageTransitionType, boolean isRedirect) { 33 | return new NavigationParams(url, isPost, hasUserGesture, pageTransitionType, 34 | isRedirect); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/ContentMain.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | import android.content.Context; 8 | 9 | import org.chromium.base.JNINamespace; 10 | 11 | /** 12 | * This class is used to initialize all types of process. It corresponds to 13 | * content/public/app/content_main.h which is not used in Android as it has 14 | * the different initialization process. 15 | * 16 | * TODO(michaelbai): Refactorying the BrowserProcessMain.java and the 17 | * ChildProcessService.java to start ContentMain, and run the process 18 | * specific initialization code in ContentMainRunner::Initialize. 19 | * 20 | **/ 21 | @JNINamespace("content") 22 | public class ContentMain { 23 | /** 24 | * Initialize application context in native side. 25 | **/ 26 | public static void initApplicationContext(Context context) { 27 | nativeInitApplicationContext(context); 28 | } 29 | 30 | /** 31 | * Start the ContentMainRunner in native side. 32 | **/ 33 | public static int start() { 34 | return nativeStart(); 35 | } 36 | 37 | private static native void nativeInitApplicationContext(Context context); 38 | private static native int nativeStart(); 39 | } 40 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/PrivilegedProcessService.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * Privileged (unsandboxed) Services inherit from this class. We enforce the 9 | * privileged/sandboxed distinction by type-checking objects against this parent class. 10 | */ 11 | public class PrivilegedProcessService extends ChildProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/PrivilegedProcessService0.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple PrivilegedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class PrivilegedProcessService0 extends PrivilegedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/PrivilegedProcessService1.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple PrivilegedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class PrivilegedProcessService1 extends PrivilegedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/PrivilegedProcessService2.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple PrivilegedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class PrivilegedProcessService2 extends PrivilegedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * Sandboxed Services inherit from this class. We enforce the privileged/sandboxed 9 | * distinction by type-checking objects against this parent class. 10 | */ 11 | public class SandboxedProcessService extends ChildProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService0.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService0 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService1.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService1 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService10.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService10 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService11.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService11 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService12.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService12 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService2.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService2 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService3.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService3 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService4.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService4 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService5.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService5 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService6.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService6 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService7.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService7 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService8.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService8 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/app/SandboxedProcessService9.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.app; 6 | 7 | /** 8 | * This is needed to register multiple SandboxedProcess services so that we can have 9 | * more than one sandboxed process. 10 | */ 11 | public class SandboxedProcessService9 extends SandboxedProcessService { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/ActivityContentVideoViewClient.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import android.app.Activity; 8 | import android.view.Gravity; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.view.WindowManager; 12 | import android.widget.FrameLayout; 13 | 14 | /** 15 | * Uses an existing Activity to handle displaying video in full screen. 16 | */ 17 | public class ActivityContentVideoViewClient implements ContentVideoViewClient { 18 | private final Activity mActivity; 19 | private View mView; 20 | 21 | public ActivityContentVideoViewClient(Activity activity) { 22 | this.mActivity = activity; 23 | } 24 | 25 | @Override 26 | public void onShowCustomView(View view) { 27 | mActivity.getWindow().setFlags( 28 | WindowManager.LayoutParams.FLAG_FULLSCREEN, 29 | WindowManager.LayoutParams.FLAG_FULLSCREEN); 30 | 31 | mActivity.getWindow().addContentView(view, 32 | new FrameLayout.LayoutParams( 33 | ViewGroup.LayoutParams.MATCH_PARENT, 34 | ViewGroup.LayoutParams.MATCH_PARENT, 35 | Gravity.CENTER)); 36 | mView = view; 37 | } 38 | 39 | @Override 40 | public void onDestroyContentVideoView() { 41 | mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 42 | FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView(); 43 | decor.removeView(mView); 44 | mView = null; 45 | } 46 | 47 | @Override 48 | public View getVideoLoadingProgressView() { 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/ContentVideoViewClient.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import android.view.View; 8 | 9 | /** 10 | * Main callback class used by ContentVideoView. 11 | * 12 | * This contains the superset of callbacks that must be implemented by the embedder. 13 | * 14 | * onShowCustomView and onDestoryContentVideoView must be implemented, 15 | * getVideoLoadingProgressView() is optional, and may return null if not required. 16 | * 17 | * The implementer is responsible for displaying the Android view when 18 | * {@link #onShowCustomView(View)} is called. 19 | */ 20 | public interface ContentVideoViewClient { 21 | /** 22 | * Called when the video view is ready to be shown. Must be implemented. 23 | * @param view The view to show. 24 | */ 25 | public void onShowCustomView(View view); 26 | 27 | /** 28 | * Called when it's time to destroy the video view. Must be implemented. 29 | */ 30 | public void onDestroyContentVideoView(); 31 | 32 | /** 33 | * Allows the embedder to replace the view indicating that the video is loading. 34 | * If null is returned, the default video loading view is used. 35 | */ 36 | public View getVideoLoadingProgressView(); 37 | } 38 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/ContentViewDownloadDelegate.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | /** 8 | * Interface to be implemented by the embedder to handle file downloads. 9 | */ 10 | public interface ContentViewDownloadDelegate { 11 | /** 12 | * Notify the host application that a file should be downloaded. Replaces 13 | * onDownloadStart from DownloadListener. 14 | * @param downloadInfo Information about the requested download. 15 | */ 16 | void requestHttpGetDownload(DownloadInfo downloadInfo); 17 | 18 | /** 19 | * Notify the host application that a download is started. 20 | * @param filename File name of the downloaded file. 21 | * @param mimeType Mime of the downloaded item. 22 | */ 23 | void onDownloadStarted(String filename, String mimeType); 24 | 25 | /** 26 | * Notify the host application that a download has an extension indicating 27 | * a dangerous file type. 28 | * @param filename File name of the downloaded file. 29 | * @param downloadId The download id. 30 | */ 31 | void onDangerousDownload(String filename, int downloadId); 32 | } 33 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/DeviceUtils.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import android.content.Context; 8 | 9 | import org.chromium.base.CommandLine; 10 | import org.chromium.content.common.ContentSwitches; 11 | 12 | /** 13 | * A utility class that has helper methods for device configuration. 14 | */ 15 | public class DeviceUtils { 16 | 17 | /** 18 | * The minimum width that would classify the device as a tablet. 19 | */ 20 | private static final int MINIMUM_TABLET_WIDTH_DP = 600; 21 | 22 | private static Boolean sIsTablet = null; 23 | 24 | /** 25 | * @param context Android's context 26 | * @return Whether the app is should treat the device as a tablet for layout. 27 | */ 28 | public static boolean isTablet(Context context) { 29 | if (sIsTablet == null) { 30 | int minimumScreenWidthDp = context.getResources().getConfiguration(). 31 | smallestScreenWidthDp; 32 | sIsTablet = minimumScreenWidthDp >= MINIMUM_TABLET_WIDTH_DP; 33 | } 34 | return sIsTablet; 35 | } 36 | 37 | /** 38 | * Appends the switch specifying which user agent should be used for this device. 39 | * @param context The context for the caller activity. 40 | */ 41 | public static void addDeviceSpecificUserAgentSwitch(Context context) { 42 | if (isTablet(context)) { 43 | CommandLine.getInstance().appendSwitch(ContentSwitches.TABLET_UI); 44 | } else { 45 | CommandLine.getInstance().appendSwitch(ContentSwitches.USE_MOBILE_UA); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/FileDescriptorInfo.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | class FileDescriptorInfo { 8 | public int mId; 9 | public int mFd; 10 | public boolean mAutoClose; 11 | 12 | FileDescriptorInfo(int id, int fd, boolean autoClose) { 13 | mId = id; 14 | mFd = fd; 15 | mAutoClose = autoClose; 16 | } 17 | } -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/GestureEventType.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.content.browser; 6 | 7 | public class GestureEventType { 8 | public static final int SHOW_PRESS = 0; 9 | public static final int DOUBLE_TAP = 1; 10 | public static final int SINGLE_TAP_UP = 2; 11 | public static final int SINGLE_TAP_CONFIRMED = 3; 12 | public static final int SINGLE_TAP_UNCONFIRMED = 4; 13 | public static final int LONG_PRESS = 5; 14 | public static final int SCROLL_START = 6; 15 | public static final int SCROLL_BY = 7; 16 | public static final int SCROLL_END = 8; 17 | public static final int FLING_START = 9; 18 | public static final int FLING_CANCEL = 10; 19 | public static final int FLING_END = 11; 20 | public static final int PINCH_BEGIN = 12; 21 | public static final int PINCH_BY = 13; 22 | public static final int PINCH_END = 14; 23 | public static final int TAP_CANCEL = 15; 24 | public static final int LONG_TAP = 16; 25 | public static final int TAP_DOWN = 17; 26 | } 27 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/GestureEventType.template: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | public class GestureEventType { 8 | #define DEFINE_GESTURE_EVENT_TYPE(name, value) \ 9 | public static final int name = value; 10 | #include "content/browser/android/gesture_event_type_list.h" 11 | #undef DEFINE_GESTURE_EVENT_TYPE 12 | } 13 | 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/JavascriptInterface.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * Marks a method as being able to be exposed to JavaScript. This is used for safety purposes so 14 | * that only explicitly marked methods get exposed instead of every method in a class. 15 | * @see {@link ContentViewCore#addJavascriptInterface(Class, String, boolean)} 16 | */ 17 | @SuppressWarnings("javadoc") 18 | @Retention(RetentionPolicy.RUNTIME) 19 | @Target({ElementType.METHOD}) 20 | public @interface JavascriptInterface { 21 | } -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/JellyBeanContentView.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import android.content.Context; 8 | import android.os.Bundle; 9 | import android.util.AttributeSet; 10 | import android.view.accessibility.AccessibilityNodeProvider; 11 | 12 | import org.chromium.ui.base.WindowAndroid; 13 | 14 | /** 15 | * A version of {@link ContentView} that supports JellyBean features. 16 | */ 17 | class JellyBeanContentView extends ContentView { 18 | JellyBeanContentView(Context context, long nativeWebContents, WindowAndroid windowAndroid, 19 | AttributeSet attrs, int defStyle) { 20 | super(context, nativeWebContents, windowAndroid, attrs, defStyle); 21 | } 22 | 23 | @Override 24 | public boolean performAccessibilityAction(int action, Bundle arguments) { 25 | if (getContentViewCore().supportsAccessibilityAction(action)) { 26 | return getContentViewCore().performAccessibilityAction(action, arguments); 27 | } 28 | 29 | return super.performAccessibilityAction(action, arguments); 30 | } 31 | 32 | @Override 33 | public AccessibilityNodeProvider getAccessibilityNodeProvider() { 34 | AccessibilityNodeProvider provider = getContentViewCore().getAccessibilityNodeProvider(); 35 | if (provider != null) { 36 | return provider; 37 | } else { 38 | return super.getAccessibilityNodeProvider(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/MediaDrmCredentialManager.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import org.chromium.base.CalledByNative; 8 | import org.chromium.base.JNINamespace; 9 | 10 | /** 11 | * A wrapper of the android MediaDrmCredentialManager 12 | */ 13 | @JNINamespace("content") 14 | public class MediaDrmCredentialManager { 15 | private int mNativeMediaDrmCredentialManager; 16 | 17 | /** 18 | * Callback interface for getting notified from credential reset. 19 | */ 20 | public interface MediaDrmCredentialManagerCallback { 21 | /** 22 | * This method will be called when credential reset attempt is done. 23 | * @param succeeded Whether or not it succeeded. 24 | */ 25 | @CalledByNative("MediaDrmCredentialManagerCallback") 26 | public void onCredentialResetFinished(boolean succeeded); 27 | } 28 | 29 | /** 30 | * Attempts to reset the DRM credentials. 31 | * @param callback It notifies whether or not it succeeded. 32 | */ 33 | public static void resetCredentials(MediaDrmCredentialManagerCallback callback) { 34 | nativeResetCredentials(callback); 35 | } 36 | 37 | private static native void nativeResetCredentials(MediaDrmCredentialManagerCallback callback); 38 | } 39 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/NavigationClient.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | /** 8 | * Provides functionality needed to query and page history and the ability to access 9 | * items in the history. 10 | */ 11 | public interface NavigationClient { 12 | 13 | /** 14 | * Get a directed copy of the navigation history of the view. 15 | * @param isForward Whether the returned history should be entries after the current entry. 16 | * @param itemLimit The limit on the number of items included in the history. 17 | * @return A directed navigation for the page. 18 | */ 19 | public NavigationHistory getDirectedNavigationHistory(boolean isForward, int itemLimit); 20 | 21 | /** 22 | * Navigates to the specified index in the navigation entry for this page. 23 | * @param index The navigation index to navigate to. 24 | */ 25 | public void goToNavigationIndex(int index); 26 | } 27 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/NavigationHistory.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * {@link NavigationHistory} captures a snapshot of the navigation history of a 11 | * {@link ContentView}. It is a copy and will not be updated as navigation 12 | * occurs on the source {@link ContentView}. 13 | */ 14 | public class NavigationHistory { 15 | 16 | private ArrayList mEntries = new ArrayList(); 17 | private int mCurrentEntryIndex; 18 | 19 | protected void addEntry(NavigationEntry entry) { 20 | mEntries.add(entry); 21 | } 22 | 23 | /* package */ void setCurrentEntryIndex(int currentEntryIndex) { 24 | mCurrentEntryIndex = currentEntryIndex; 25 | } 26 | 27 | /** 28 | * @return The number of entries in the history. 29 | */ 30 | public int getEntryCount() { 31 | return mEntries.size(); 32 | } 33 | 34 | /** 35 | * Returns the {@link NavigationEntry} for the given index. 36 | */ 37 | public NavigationEntry getEntryAtIndex(int index) { 38 | return mEntries.get(index); 39 | } 40 | 41 | /** 42 | * Returns the index of the entry the {@link ContentView} was navigated to 43 | * when the history was fetched. 44 | */ 45 | public int getCurrentEntryIndex() { 46 | return mCurrentEntryIndex; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/OWNERS: -------------------------------------------------------------------------------- 1 | # Device Motion / Orientation API related 2 | per-file DeviceMotionAndOrientation.java=mvanouwerkerk@chromium.org 3 | per-file DeviceMotionAndOrientation.java=timvolodine@chromium.org 4 | 5 | # Geolocation API related 6 | per-file LocationProvider.java=mvanouwerkerk@chromium.org 7 | per-file LocationProvider.java=timvolodine@chromium.org 8 | 9 | # Input handling related 10 | jdduke@chromium.org 11 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/PageInfo.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import android.view.View; 8 | 9 | /** 10 | * A minimal interface for a View to implement to be shown in a Tab. The main implementation of 11 | * this is ContentView but other Views can also implement this, enabling them to be shown in a Tab 12 | * as well. 13 | */ 14 | public interface PageInfo { 15 | /** 16 | * @return The title of the page. 17 | */ 18 | String getTitle(); 19 | 20 | /** 21 | * @return The background color of the page. 22 | */ 23 | int getBackgroundColor(); 24 | 25 | /** 26 | * @return The View to display the page. This is always non-null. 27 | */ 28 | View getView(); 29 | } 30 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/PageTransitionTypes.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.content.browser; 6 | 7 | public class PageTransitionTypes { 8 | public static final int PAGE_TRANSITION_LINK = 0; 9 | public static final int PAGE_TRANSITION_TYPED = 1; 10 | public static final int PAGE_TRANSITION_AUTO_BOOKMARK = 2; 11 | public static final int PAGE_TRANSITION_AUTO_SUBFRAME = 3; 12 | public static final int PAGE_TRANSITION_MANUAL_SUBFRAME = 4; 13 | public static final int PAGE_TRANSITION_GENERATED = 5; 14 | public static final int PAGE_TRANSITION_AUTO_TOPLEVEL = 6; 15 | public static final int PAGE_TRANSITION_FORM_SUBMIT = 7; 16 | public static final int PAGE_TRANSITION_RELOAD = 8; 17 | public static final int PAGE_TRANSITION_KEYWORD = 9; 18 | public static final int PAGE_TRANSITION_KEYWORD_GENERATED = 10; 19 | public static final int PAGE_TRANSITION_LAST_CORE = PAGE_TRANSITION_KEYWORD_GENERATED; 20 | public static final int PAGE_TRANSITION_CORE_MASK = 0xFF; 21 | public static final int PAGE_TRANSITION_BLOCKED = 0x00800000; 22 | public static final int PAGE_TRANSITION_FORWARD_BACK = 0x01000000; 23 | public static final int PAGE_TRANSITION_FROM_ADDRESS_BAR = 0x02000000; 24 | public static final int PAGE_TRANSITION_HOME_PAGE = 0x04000000; 25 | public static final int PAGE_TRANSITION_FROM_API = 0x08000000; 26 | public static final int PAGE_TRANSITION_CHAIN_START = 0x10000000; 27 | public static final int PAGE_TRANSITION_CHAIN_END = 0x20000000; 28 | public static final int PAGE_TRANSITION_CLIENT_REDIRECT = 0x40000000; 29 | public static final int PAGE_TRANSITION_SERVER_REDIRECT = 0x80000000; 30 | public static final int PAGE_TRANSITION_IS_REDIRECT_MASK = 0xC0000000; 31 | public static final int PAGE_TRANSITION_QUALIFIER_MASK = 0xFFFFFF00; 32 | } 33 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/PageTransitionTypes.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | public class PageTransitionTypes { 8 | #define PAGE_TRANSITION(label, value) public static final int \ 9 | PAGE_TRANSITION_ ## label = value; 10 | #include "content/public/common/page_transition_types_list.h" 11 | #undef PAGE_TRANSITION 12 | } 13 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/PositionObserver.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | /** 8 | * Used to register listeners that can be notified of changes to the position of a view. 9 | */ 10 | public interface PositionObserver { 11 | public interface Listener { 12 | /** 13 | * Called during predraw if the position of the underlying view has changed. 14 | */ 15 | void onPositionChanged(int positionX, int positionY); 16 | } 17 | 18 | /** 19 | * @return The current x position of the observed view. 20 | */ 21 | int getPositionX(); 22 | 23 | /** 24 | * @return The current y position of the observed view. 25 | */ 26 | int getPositionY(); 27 | 28 | /** 29 | * Register a listener to be called when the position of the underlying view changes. 30 | */ 31 | void addListener(Listener listener); 32 | 33 | /** 34 | * Remove a previously installed listener. 35 | */ 36 | void removeListener(Listener listener); 37 | } 38 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/PowerSaveBlocker.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import org.chromium.base.CalledByNative; 8 | import org.chromium.ui.base.ViewAndroid; 9 | 10 | class PowerSaveBlocker { 11 | @CalledByNative 12 | private static void applyBlock(ViewAndroid view) { 13 | view.incrementKeepScreenOnCount(); 14 | } 15 | 16 | @CalledByNative 17 | private static void removeBlock(ViewAndroid view) { 18 | view.decrementKeepScreenOnCount(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/SpeechRecognitionError.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.content.browser; 6 | 7 | public class SpeechRecognitionError { 8 | 9 | 10 | 11 | 12 | 13 | public static final int NONE = 0; 14 | 15 | 16 | public static final int ABORTED = 1; 17 | 18 | 19 | public static final int AUDIO = 2; 20 | 21 | 22 | public static final int NETWORK = 3; 23 | 24 | 25 | public static final int NOT_ALLOWED = 4; 26 | 27 | 28 | public static final int NO_SPEECH = 5; 29 | 30 | 31 | public static final int NO_MATCH = 6; 32 | 33 | 34 | public static final int BAD_GRAMMAR = 7; 35 | 36 | 37 | public static final int LAST = 7; 38 | } 39 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/SpeechRecognitionError.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | public class SpeechRecognitionError { 8 | #define DEFINE_SPEECH_RECOGNITION_ERROR(x,y) public static final int x = y; 9 | #include "content/public/common/speech_recognition_error_list.h" 10 | #undef DEFINE_SPEECH_RECOGNITION_ERROR 11 | } 12 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/TracingIntentHandler.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import org.chromium.base.JNINamespace; 8 | 9 | /** 10 | * Handler for tracing related intent. 11 | */ 12 | @JNINamespace("content") 13 | public class TracingIntentHandler { 14 | 15 | /** 16 | * Begin recording trace events. 17 | * 18 | * @param path Specifies where the trace data will be saved when tracing is stopped. 19 | */ 20 | public static void beginTracing(String path) { 21 | nativeBeginTracing(path); 22 | } 23 | 24 | /** 25 | * Stop recording trace events, and dump the data to the file 26 | */ 27 | public static void endTracing() { 28 | nativeEndTracing(); 29 | } 30 | 31 | private static native void nativeBeginTracing(String path); 32 | private static native void nativeEndTracing(); 33 | } 34 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/VSyncManager.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | public abstract class VSyncManager { 8 | /** 9 | * Interface for requesting notification of the display vsync signal. The provider will call 10 | * Listener.onVSync() to notify about vsync. The number of registrations and unregistrations of 11 | * a given listener must be balanced. 12 | */ 13 | public static interface Provider { 14 | void registerVSyncListener(Listener listener); 15 | void unregisterVSyncListener(Listener listener); 16 | } 17 | 18 | /** 19 | * Interface for receiving vsync notifications and information about the display refresh 20 | * interval. 21 | */ 22 | public static interface Listener { 23 | /** 24 | * Notification of a vsync event. 25 | * @param frameTimeMicros The latest vsync frame time in microseconds. 26 | */ 27 | void onVSync(long frameTimeMicros); 28 | 29 | /** 30 | * Update with the latest vsync parameters. 31 | * @param tickTimeMicros The latest vsync tick time in microseconds. 32 | * @param intervalMicros The vsync interval in microseconds. 33 | */ 34 | void updateVSync(long tickTimeMicros, long intervalMicros); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/VibrationMessageFilter.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser; 6 | 7 | import android.content.Context; 8 | import android.os.Vibrator; 9 | 10 | import org.chromium.base.CalledByNative; 11 | import org.chromium.base.JNINamespace; 12 | 13 | /** 14 | * This is the implementation of the C++ counterpart VibrationMessageFilter. 15 | */ 16 | @JNINamespace("content") 17 | class VibrationMessageFilter { 18 | 19 | private final Vibrator mVibrator; 20 | 21 | @CalledByNative 22 | private static VibrationMessageFilter create(Context context) { 23 | return new VibrationMessageFilter(context); 24 | } 25 | 26 | @CalledByNative 27 | private void vibrate(long milliseconds) { 28 | mVibrator.vibrate(milliseconds); 29 | } 30 | 31 | @CalledByNative 32 | private void cancelVibration() { 33 | mVibrator.cancel(); 34 | } 35 | 36 | private VibrationMessageFilter(Context context) { 37 | mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/input/CursorController.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser.input; 6 | 7 | import android.view.ViewTreeObserver; 8 | 9 | /** 10 | * A CursorController instance can be used to control a cursor in the text. 11 | */ 12 | interface CursorController extends ViewTreeObserver.OnTouchModeChangeListener { 13 | 14 | /** 15 | * Hide the cursor controller from screen. 16 | */ 17 | void hide(); 18 | 19 | /** 20 | * @return true if the CursorController is currently visible 21 | */ 22 | boolean isShowing(); 23 | 24 | /** 25 | * Called when the handle is about to start updating its position. 26 | * @param handle 27 | */ 28 | void beforeStartUpdatingPosition(HandleView handle); 29 | 30 | /** 31 | * Update the controller's position. 32 | */ 33 | void updatePosition(HandleView handle, int x, int y); 34 | 35 | /** 36 | * Called when the view is detached from window. Perform house keeping task, such as 37 | * stopping Runnable thread that would otherwise keep a reference on the context, thus 38 | * preventing the activity to be recycled. 39 | */ 40 | void onDetached(); 41 | } 42 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/input/MonthPickerDialog.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser.input; 6 | 7 | import android.content.Context; 8 | 9 | import org.chromium.content.R; 10 | 11 | public class MonthPickerDialog extends TwoFieldDatePickerDialog { 12 | 13 | /** 14 | * @param context The context the dialog is to run in. 15 | * @param callBack How the parent is notified that the date is set. 16 | * @param year The initial year of the dialog. 17 | * @param monthOfYear The initial month of the dialog. 18 | */ 19 | public MonthPickerDialog(Context context, OnValueSetListener callBack, 20 | int year, int monthOfYear, double minMonth, double maxMonth) { 21 | super(context, callBack, year, monthOfYear, minMonth, maxMonth); 22 | setTitle(R.string.month_picker_dialog_title); 23 | } 24 | 25 | @Override 26 | protected TwoFieldDatePicker createPicker(Context context, double minValue, double maxValue) { 27 | return new MonthPicker(context, minValue, maxValue); 28 | } 29 | 30 | /** 31 | * Gets the {@link MonthPicker} contained in this dialog. 32 | * 33 | * @return The calendar view. 34 | */ 35 | public MonthPicker getMonthPicker() { 36 | return (MonthPicker) mPicker; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/input/PopupItemType.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.content.browser.input; 6 | 7 | public class PopupItemType { 8 | public static final int GROUP = 0; 9 | public static final int DISABLED = 1; 10 | public static final int ENABLED = 2; 11 | } 12 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/input/PopupItemType.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser.input; 6 | 7 | public class PopupItemType { 8 | #define DEFINE_POPUP_ITEM_TYPE(name, value) public static final int name = value; 9 | #include "content/browser/android/popup_item_type_list.h" 10 | #undef DEFINE_POPUP_ITEM_TYPE 11 | } 12 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/browser/input/SelectPopupItem.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser.input; 6 | 7 | /** 8 | * Select popup item containing the label, the type and the enabled state 9 | * of an item belonging to a select popup dialog. 10 | */ 11 | public class SelectPopupItem { 12 | private final String mLabel; 13 | private final int mType; 14 | 15 | public SelectPopupItem(String label, int type) { 16 | mLabel = label; 17 | mType = type; 18 | } 19 | 20 | public String getLabel() { 21 | return mLabel; 22 | } 23 | 24 | public int getType() { 25 | return mType; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/DeviceTelephonyInfo.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.common; 6 | 7 | import android.content.Context; 8 | import android.telephony.TelephonyManager; 9 | 10 | import org.chromium.base.CalledByNative; 11 | 12 | /** 13 | * This class facilitates access to the current telephony region, 14 | * typically only available using the Java SDK. 15 | */ 16 | public class DeviceTelephonyInfo { 17 | 18 | private TelephonyManager mTelManager; 19 | 20 | private DeviceTelephonyInfo(Context context) { 21 | Context appContext = context.getApplicationContext(); 22 | mTelManager = (TelephonyManager) appContext.getSystemService(Context.TELEPHONY_SERVICE); 23 | } 24 | 25 | /** 26 | * @return The ISO country code equivalent of the current MCC. 27 | */ 28 | @CalledByNative 29 | public String getNetworkCountryIso() { 30 | return mTelManager.getNetworkCountryIso(); 31 | } 32 | 33 | /** 34 | * Creates DeviceTelephonyInfo for a given Context. 35 | * 36 | * @param context A context to use. 37 | * @return DeviceTelephonyInfo associated with a given Context. 38 | */ 39 | @CalledByNative 40 | public static DeviceTelephonyInfo create(Context context) { 41 | return new DeviceTelephonyInfo(context); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/IChildProcessCallback.aidl: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.common; 6 | 7 | import android.view.Surface; 8 | 9 | interface IChildProcessCallback { 10 | 11 | // Conduit to pass a Surface from the sandboxed renderer to the plugin. 12 | void establishSurfacePeer( 13 | int pid, in Surface surface, int primaryID, int secondaryID); 14 | 15 | Surface getViewSurface(int surfaceId); 16 | } 17 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/IChildProcessService.aidl: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.common; 6 | 7 | import org.chromium.content.common.IChildProcessCallback; 8 | 9 | import android.view.Surface; 10 | import android.os.Bundle; 11 | 12 | interface IChildProcessService { 13 | // Sets up the initial IPC channel and returns the pid of the child process. 14 | int setupConnection(in Bundle args, IChildProcessCallback callback); 15 | } 16 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/ResultCodes.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.content.common; 6 | 7 | public class ResultCodes { 8 | public static final int RESULT_CODE_NORMAL_EXIT = 0; 9 | public static final int RESULT_CODE_KILLED = 1; 10 | public static final int RESULT_CODE_HUNG = 2; 11 | public static final int RESULT_CODE_KILLED_BAD_MESSAGE = 3; 12 | } 13 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/ResultCodes.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.common; 6 | 7 | public class ResultCodes { 8 | #define RESULT_CODE(label, value) public static final int \ 9 | RESULT_CODE_ ## label = value; 10 | #include "content/public/common/result_codes_list.h" 11 | #undef RESULT_CODE 12 | } 13 | 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/TopControlsState.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.content.common; 6 | 7 | public class TopControlsState { 8 | 9 | 10 | 11 | 12 | 13 | 14 | public static final int SHOWN = 1; 15 | public static final int HIDDEN = 2; 16 | public static final int BOTH = 3; 17 | } 18 | -------------------------------------------------------------------------------- /java/src/org/chromium/content/common/TopControlsState.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.common; 6 | 7 | public class TopControlsState { 8 | #define DEFINE_TOP_CONTROLS_STATE(name, value) public static final int name = value; 9 | #include "content/public/common/top_controls_state_list.h" 10 | #undef DEFINE_TOP_CONTROLS_STATE 11 | } 12 | 13 | -------------------------------------------------------------------------------- /java/src/org/chromium/content_public/DEPS: -------------------------------------------------------------------------------- 1 | include_rules = [ 2 | "-content/public/android/java/src/org/chromium/content", 3 | ] 4 | -------------------------------------------------------------------------------- /java/src/org/chromium/content_public/browser/NavigationController.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content_public.browser; 6 | 7 | /** 8 | * The NavigationController Java wrapper to allow communicating with the native 9 | * NavigationController object. 10 | */ 11 | public interface NavigationController { 12 | /** 13 | * @return Whether back navigation is possible from the "current entry". 14 | */ 15 | boolean canGoBack(); 16 | 17 | /** 18 | * @return Whether forward navigation is possible from the "current entry". 19 | */ 20 | boolean canGoForward(); 21 | 22 | /** 23 | * @param offset The offset into the navigation history. 24 | * @return Whether we can move in history by given offset 25 | */ 26 | boolean canGoToOffset(int offset); 27 | 28 | /** 29 | * Navigates to the specified offset from the "current entry". Does nothing if the offset is 30 | * out of bounds. 31 | * @param offset The offset into the navigation history. 32 | */ 33 | void goToOffset(int offset); 34 | 35 | /** 36 | * Navigates to the specified index in the navigation entry for this page. 37 | * @param index The navigation index to navigate to. 38 | */ 39 | void goToNavigationIndex(int index); 40 | 41 | /** 42 | * Goes to the navigation entry before the current one. 43 | */ 44 | void goBack(); 45 | 46 | /** 47 | * Goes to the navigation entry following the current one. 48 | */ 49 | void goForward(); 50 | } 51 | -------------------------------------------------------------------------------- /java/src/org/chromium/content_public/browser/WebContents.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content_public.browser; 6 | 7 | /** 8 | * The WebContents Java wrapper to allow communicating with the native WebContents object. 9 | */ 10 | public interface WebContents { 11 | /** 12 | * @return The navigation controller associated with this WebContents. 13 | */ 14 | NavigationController getNavigationController(); 15 | } 16 | -------------------------------------------------------------------------------- /java/src/org/chromium/media/ImageFormat.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.media; 6 | 7 | class AndroidImageFormatList { 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | static final int ANDROID_IMAGEFORMAT_NV21 = 17; 16 | static final int ANDROID_IMAGEFORMAT_YV12 = 842094169; 17 | 18 | static final int ANDROID_IMAGEFORMAT_UNKNOWN = 0; 19 | } 20 | -------------------------------------------------------------------------------- /java/src/org/chromium/media/ImageFormat.template: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.media; 6 | 7 | class AndroidImageFormatList { 8 | #define DEFINE_ANDROID_IMAGEFORMAT(name, value) \ 9 | static final int name = value; 10 | #include "media/video/capture/android/imageformat_list.h" 11 | #undef DEFINE_ANDROID_IMAGEFORMAT 12 | } -------------------------------------------------------------------------------- /java/src/org/chromium/net/AndroidPrivateKey.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.net; 6 | 7 | import org.chromium.base.CalledByNative; 8 | import org.chromium.base.JNINamespace; 9 | 10 | /** 11 | * Abstract private key that bundles the PrivateKey and AndroidKeyStore that it belongs to. 12 | */ 13 | @JNINamespace("net::android") 14 | public interface AndroidPrivateKey { 15 | /** @return AndroidKeyStore that handles this key. */ 16 | @CalledByNative 17 | AndroidKeyStore getKeyStore(); 18 | } 19 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/CertVerifyResultAndroid.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.net; 6 | 7 | public class CertVerifyResultAndroid { 8 | 9 | 10 | 11 | 12 | public static final int VERIFY_OK = 0; 13 | 14 | 15 | public static final int VERIFY_FAILED = -1; 16 | 17 | 18 | public static final int VERIFY_NO_TRUSTED_ROOT = -2; 19 | 20 | 21 | public static final int VERIFY_EXPIRED = -3; 22 | 23 | 24 | public static final int VERIFY_NOT_YET_VALID = -4; 25 | 26 | 27 | public static final int VERIFY_UNABLE_TO_PARSE = -5; 28 | 29 | 30 | 31 | public static final int VERIFY_INCORRECT_KEY_USAGE = -6; 32 | } 33 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/CertVerifyStatusAndroid.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.net; 6 | 7 | public class CertVerifyStatusAndroid { 8 | 9 | 10 | 11 | 12 | public static final int VERIFY_OK = 0; 13 | 14 | 15 | public static final int VERIFY_FAILED = -1; 16 | 17 | 18 | public static final int VERIFY_NO_TRUSTED_ROOT = -2; 19 | 20 | 21 | public static final int VERIFY_EXPIRED = -3; 22 | 23 | 24 | public static final int VERIFY_NOT_YET_VALID = -4; 25 | 26 | 27 | public static final int VERIFY_UNABLE_TO_PARSE = -5; 28 | 29 | 30 | 31 | public static final int VERIFY_INCORRECT_KEY_USAGE = -6; 32 | } 33 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/CertificateMimeType.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.net; 6 | 7 | public class CertificateMimeType { 8 | 9 | 10 | public static final int UNKNOWN = 0; 11 | public static final int X509_USER_CERT = 1; 12 | public static final int X509_CA_CERT = 2; 13 | public static final int PKCS12_ARCHIVE = 3; 14 | } 15 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/GURLUtils.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.net; 6 | 7 | import org.chromium.base.JNINamespace; 8 | 9 | /** 10 | * Class to access the GURL library from java. 11 | */ 12 | @JNINamespace("net") 13 | public final class GURLUtils { 14 | 15 | /** 16 | * Get the origin of an url: Ex getOrigin("http://www.example.com:8080/index.html?bar=foo") 17 | * would return "http://www.example.com:8080". It will return an empty string for an 18 | * invalid url. 19 | * 20 | * @return The origin of the url 21 | */ 22 | public static String getOrigin(String url) { 23 | return nativeGetOrigin(url); 24 | } 25 | 26 | /** 27 | * Get the scheme of the url (e.g. http, https, file). The returned string 28 | * contains everything before the "://". 29 | * 30 | * @return The scheme of the url. 31 | */ 32 | public static String getScheme(String url) { 33 | return nativeGetScheme(url); 34 | } 35 | 36 | private static native String nativeGetOrigin(String url); 37 | private static native String nativeGetScheme(String url); 38 | } 39 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/IRemoteAndroidKeyStore.aidl: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.net; 6 | 7 | import org.chromium.net.IRemoteAndroidKeyStoreCallbacks; 8 | 9 | /** 10 | * Interface for communication with an Android KeyStore in another process. 11 | */ 12 | interface IRemoteAndroidKeyStore { 13 | // Remote calls for SSlClientCertificateRequest - these allow retrieving 14 | // the alias of the certificate to be used, its encoded chain and a handle 15 | // for identifying a private key in the remote process. 16 | String getClientCertificateAlias(); 17 | byte[] getEncodedCertificateChain(in String alias); 18 | int getPrivateKeyHandle(in String alias); 19 | 20 | // Registers callbacks for service->client communication. 21 | void setClientCallbacks(IRemoteAndroidKeyStoreCallbacks callbacks); 22 | 23 | // Remote calls for AndroidKeyStore - these functions are performing operations 24 | // with a PrivateKey in the remote process using the handle provided by 25 | // |getPrivateKeyHandle|. 26 | byte[] getRSAKeyModulus(in int handle); 27 | byte[] getPrivateKeyEncodedBytes(in int handle); 28 | byte[] getDSAKeyParamQ(in int handle); 29 | byte[] getECKeyOrder(in int handle); 30 | byte[] rawSignDigestWithPrivateKey(in int handle, in byte[] message); 31 | int getPrivateKeyType(in int handle); 32 | void releaseKey(in int handle); 33 | } 34 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/IRemoteAndroidKeyStoreCallbacks.aidl: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.net; 6 | 7 | /** 8 | * Interface for communication from the remote authentication service back to the client. 9 | */ 10 | interface IRemoteAndroidKeyStoreCallbacks { 11 | /** 12 | * A critical failure has occurred and the service won't be able to recover. 13 | * The client should unbind and optionally rebind at a later time. 14 | */ 15 | void onDisabled(); 16 | 17 | /** 18 | * The service has started up and is fully initialized. This allows for the 19 | * service to take some time to initialize. Remote calls shouldn't be invoked 20 | * until this call has fired. 21 | */ 22 | void onInitComplete(); 23 | } 24 | -------------------------------------------------------------------------------- /java/src/org/chromium/net/PrivateKeyType.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.net; 6 | 7 | public class PrivateKeyType { 8 | 9 | public static final int RSA = 0; 10 | public static final int DSA = 1; 11 | public static final int ECDSA = 2; 12 | public static final int INVALID = 255; 13 | } 14 | -------------------------------------------------------------------------------- /java/src/org/chromium/ui/ColorSuggestion.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui; 6 | 7 | /** 8 | * Color suggestion container used to store information for each color button that will be shown in 9 | * the simple color picker. 10 | */ 11 | public class ColorSuggestion { 12 | final int mColor; 13 | final String mLabel; 14 | 15 | /** 16 | * Constructs a color suggestion container. 17 | * @param color The suggested color. 18 | * @param label The label for the suggestion. 19 | */ 20 | public ColorSuggestion(int color, String label) { 21 | mColor = color; 22 | mLabel = label; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /java/src/org/chromium/ui/OnColorChangedListener.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui; 6 | 7 | /** 8 | * The callback used to indicate the user changed the color. 9 | */ 10 | public interface OnColorChangedListener { 11 | 12 | /** 13 | * Called upon a color change. 14 | * 15 | * @param color The color that was set. 16 | */ 17 | void onColorChanged(int color); 18 | } -------------------------------------------------------------------------------- /java/src/org/chromium/ui/ViewAndroidDelegate.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui; 6 | 7 | import android.view.View; 8 | 9 | /** 10 | * Interface to acquire and release anchor views from the implementing View. 11 | */ 12 | public interface ViewAndroidDelegate { 13 | 14 | /** 15 | * @return An anchor view that can be used to anchor decoration views like Autofill popup. 16 | */ 17 | View acquireAnchorView(); 18 | 19 | /** 20 | * Set the anchor view to specified position and width (all units in dp). 21 | * @param view The anchor view that needs to be positioned. 22 | * @param x X coordinate of the top left corner of the anchor view. 23 | * @param y Y coordinate of the top left corner of the anchor view. 24 | * @param width The width of the anchor view. 25 | * @param height The height of the anchor view. 26 | */ 27 | void setAnchorViewPosition(View view, float x, float y, float width, float height); 28 | 29 | /** 30 | * Release given anchor view. 31 | * @param anchorView The anchor view that needs to be released. 32 | */ 33 | void releaseAnchorView(View anchorView); 34 | } -------------------------------------------------------------------------------- /java/src/org/chromium/ui/WindowOpenDisposition.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | package org.chromium.ui; 6 | 7 | public class WindowOpenDisposition { 8 | public static final int UNKNOWN = 0; 9 | public static final int SUPPRESS_OPEN = 1; 10 | public static final int CURRENT_TAB = 2; 11 | 12 | public static final int SINGLETON_TAB = 3; 13 | public static final int NEW_FOREGROUND_TAB = 4; 14 | public static final int NEW_BACKGROUND_TAB = 5; 15 | public static final int NEW_POPUP = 6; 16 | public static final int NEW_WINDOW = 7; 17 | public static final int SAVE_TO_DISK = 8; 18 | public static final int OFF_THE_RECORD = 9; 19 | public static final int IGNORE_ACTION = 10; 20 | 21 | public static final int WINDOW_OPEN_DISPOSITION_LAST = 10; 22 | } 23 | -------------------------------------------------------------------------------- /java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui.autofill; 6 | 7 | import android.graphics.Canvas; 8 | import android.graphics.ColorFilter; 9 | import android.graphics.Paint; 10 | import android.graphics.PixelFormat; 11 | import android.graphics.Rect; 12 | import android.graphics.drawable.Drawable; 13 | 14 | class AutofillDividerDrawable extends Drawable { 15 | 16 | private Paint mPaint; 17 | private Rect mDividerRect; 18 | 19 | public AutofillDividerDrawable() { 20 | mPaint = new Paint(); 21 | mDividerRect = new Rect(); 22 | } 23 | 24 | @Override 25 | public void draw(Canvas canvas) { 26 | canvas.drawRect(mDividerRect, mPaint); 27 | } 28 | 29 | @Override 30 | public void onBoundsChange(Rect bounds) { 31 | mDividerRect.set(0, 0, bounds.width(), mDividerRect.height()); 32 | } 33 | 34 | public void setHeight(int height) { 35 | mDividerRect.set(0, 0, mDividerRect.right, height); 36 | } 37 | 38 | public void setColor(int color) { 39 | mPaint.setColor(color); 40 | } 41 | 42 | @Override 43 | public void setAlpha(int alpha) { 44 | } 45 | 46 | @Override 47 | public void setColorFilter(ColorFilter cf) { 48 | } 49 | 50 | @Override 51 | public int getOpacity() { 52 | return PixelFormat.OPAQUE; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /java/src/org/chromium/ui/autofill/AutofillSuggestion.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui.autofill; 6 | 7 | /** 8 | * Autofill suggestion container used to store information needed for each Autofill popup entry. 9 | */ 10 | public class AutofillSuggestion { 11 | final String mLabel; 12 | final String mSublabel; 13 | final int mUniqueId; 14 | 15 | /** 16 | * Constructs a Autofill suggestion container. 17 | * @param name The name of the Autofill suggestion. 18 | * @param label The describing label of the Autofill suggestion. 19 | * @param uniqueId The unique id used to identify the Autofill suggestion. 20 | */ 21 | public AutofillSuggestion(String name, String label, int uniqueId) { 22 | mLabel = name; 23 | mSublabel = label; 24 | mUniqueId = uniqueId; 25 | } 26 | } -------------------------------------------------------------------------------- /java/src/org/chromium/ui/base/ViewAndroidDelegate.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui.base; 6 | 7 | import android.view.View; 8 | 9 | /** 10 | * Interface to acquire and release anchor views from the implementing View. 11 | */ 12 | public interface ViewAndroidDelegate { 13 | 14 | /** 15 | * @return An anchor view that can be used to anchor decoration views like Autofill popup. 16 | */ 17 | View acquireAnchorView(); 18 | 19 | /** 20 | * Set the anchor view to specified position and width (all units in dp). 21 | * @param view The anchor view that needs to be positioned. 22 | * @param x X coordinate of the top left corner of the anchor view. 23 | * @param y Y coordinate of the top left corner of the anchor view. 24 | * @param width The width of the anchor view. 25 | * @param height The height of the anchor view. 26 | */ 27 | void setAnchorViewPosition(View view, float x, float y, float width, float height); 28 | 29 | /** 30 | * Release given anchor view. 31 | * @param anchorView The anchor view that needs to be released. 32 | */ 33 | void releaseAnchorView(View anchorView); 34 | } 35 | -------------------------------------------------------------------------------- /java/src/org/chromium/ui/gfx/SurfaceTextureListener.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui.gfx; 6 | 7 | import android.graphics.SurfaceTexture; 8 | 9 | import org.chromium.base.JNINamespace; 10 | 11 | /** 12 | * Listener to an android SurfaceTexture object for frame availability. 13 | */ 14 | @JNINamespace("gfx") 15 | class SurfaceTextureListener implements SurfaceTexture.OnFrameAvailableListener { 16 | // Used to determine the class instance to dispatch the native call to. 17 | private final int mNativeSurfaceTextureListener; 18 | 19 | SurfaceTextureListener(int nativeSurfaceTextureListener) { 20 | assert nativeSurfaceTextureListener != 0; 21 | mNativeSurfaceTextureListener = nativeSurfaceTextureListener; 22 | } 23 | 24 | @Override 25 | public void onFrameAvailable(SurfaceTexture surfaceTexture) { 26 | nativeFrameAvailable(mNativeSurfaceTextureListener); 27 | } 28 | 29 | @Override 30 | protected void finalize() throws Throwable { 31 | try { 32 | nativeDestroy(mNativeSurfaceTextureListener); 33 | } finally { 34 | super.finalize(); 35 | } 36 | } 37 | 38 | private native void nativeFrameAvailable(int nativeSurfaceTextureListener); 39 | private native void nativeDestroy(int nativeSurfaceTextureListener); 40 | } 41 | -------------------------------------------------------------------------------- /java/src/org/chromium/ui/gl/SurfaceTextureListener.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.ui.gl; 6 | 7 | import android.graphics.SurfaceTexture; 8 | 9 | import org.chromium.base.JNINamespace; 10 | 11 | /** 12 | * Listener to an android SurfaceTexture object for frame availability. 13 | */ 14 | @JNINamespace("gfx") 15 | class SurfaceTextureListener implements SurfaceTexture.OnFrameAvailableListener { 16 | // Used to determine the class instance to dispatch the native call to. 17 | private final long mNativeSurfaceTextureListener; 18 | 19 | SurfaceTextureListener(long nativeSurfaceTextureListener) { 20 | assert nativeSurfaceTextureListener != 0; 21 | mNativeSurfaceTextureListener = nativeSurfaceTextureListener; 22 | } 23 | 24 | @Override 25 | public void onFrameAvailable(SurfaceTexture surfaceTexture) { 26 | nativeFrameAvailable(mNativeSurfaceTextureListener); 27 | } 28 | 29 | @Override 30 | protected void finalize() throws Throwable { 31 | try { 32 | nativeDestroy(mNativeSurfaceTextureListener); 33 | } finally { 34 | super.finalize(); 35 | } 36 | } 37 | 38 | private native void nativeFrameAvailable(long nativeSurfaceTextureListener); 39 | private native void nativeDestroy(long nativeSurfaceTextureListener); 40 | } 41 | -------------------------------------------------------------------------------- /native/utils/Functor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_FUNCTOR_H 18 | #define ANDROID_FUNCTOR_H 19 | 20 | #include 21 | 22 | namespace android { 23 | 24 | class Functor { 25 | public: 26 | Functor() {} 27 | virtual ~Functor() {} 28 | virtual status_t operator ()(int what, void* data) { return NO_ERROR; } 29 | }; 30 | 31 | }; // namespace android 32 | 33 | #endif // ANDROID_FUNCTOR_H 34 | -------------------------------------------------------------------------------- /testshell/java/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /testshell/java/assets/webviewchromium.pak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/assets/webviewchromium.pak -------------------------------------------------------------------------------- /testshell/java/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/ic_launcher-web.png -------------------------------------------------------------------------------- /testshell/java/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/libs/android-support-v4.jar -------------------------------------------------------------------------------- /testshell/java/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /testshell/java/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-19 15 | android.library.reference.1=../../java 16 | -------------------------------------------------------------------------------- /testshell/java/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/java/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/java/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/java/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/java/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/java/res/drawable/progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /testshell/java/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /testshell/java/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /testshell/java/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | -------------------------------------------------------------------------------- /testshell/java/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /testshell/java/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /testshell/java/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | WebView外壳 10 | 设置 11 | Hello world! 12 | 13 | basic page test 14 | 15 | 登录 %s1 \"%s2\" 16 | "姓名" 17 | "密码" 18 | "登录" 19 | 20 | -------------------------------------------------------------------------------- /testshell/java/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /testshell/java/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | WebViewShell 10 | Settings 11 | Hello world! 12 | 13 | basic page test 14 | 15 | 16 | 18 | Sign in to %s1 \"%s2\" 19 | 20 | Name 21 | 22 | Password 23 | 24 | Sign in 25 | -------------------------------------------------------------------------------- /testshell/java/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /testshell/java/src/com/mogoweb/chrome/shell/ShellApplication.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package com.mogoweb.chrome.shell; 6 | 7 | import android.app.Application; 8 | 9 | public class ShellApplication extends Application { 10 | 11 | @Override 12 | public void onCreate() { 13 | super.onCreate(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testshell/javatests/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 12 | 13 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /testshell/javatests/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /testshell/javatests/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /testshell/javatests/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/javatests/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/javatests/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/javatests/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/javatests/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/javatests/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/javatests/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mogoweb/chromium_webview/9dc98e4cfa274a55e08554440c9e46074c9b0ebf/testshell/javatests/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /testshell/javatests/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WebViewShellTestTest 5 | 6 | -------------------------------------------------------------------------------- /testshell/javatests/src/com/mogoweb/chrome/shell/test/BackForwardListTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 mogoweb. All rights reserved. 2 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package com.mogoweb.chrome.shell.test; 7 | 8 | import org.chromium.base.test.util.Feature; 9 | 10 | import android.test.suitebuilder.annotation.SmallTest; 11 | 12 | import com.mogoweb.chrome.WebBackForwardList; 13 | import com.mogoweb.chrome.WebHistoryItem; 14 | 15 | /** 16 | * Tests for the WebBackForwardList class. 17 | */ 18 | public class BackForwardListTest extends WebViewShellTestBase { 19 | 20 | private TestWebViewClient mWebViewClient = new TestWebViewClient(); 21 | 22 | @Override 23 | public void setUp() throws Exception { 24 | super.setUp(); 25 | 26 | mWebView.setWebViewClient(mWebViewClient); 27 | } 28 | 29 | @SmallTest 30 | @Feature({"AndroidWebView"}) 31 | public void testCopyBackForwardList() throws Throwable { 32 | loadUrlSync(mWebView, 33 | mWebViewClient.getOnPageFinishedHelper(), "http://mogoweb.net"); 34 | 35 | WebBackForwardList list = mWebView.copyBackForwardList(); 36 | assertEquals(1, list.getSize()); 37 | assertEquals(0, list.getCurrentIndex()); 38 | WebHistoryItem item = list.getCurrentItem(); 39 | assertNotNull(item); 40 | assertEquals(item.getUrl(), "http://mogoweb.net/"); 41 | assertNull(item.getFavicon()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /testshell/javatests/src/com/mogoweb/chrome/shell/test/WebViewShellUrlTest.java: -------------------------------------------------------------------------------- 1 | package com.mogoweb.chrome.shell.test; 2 | 3 | import android.test.suitebuilder.annotation.SmallTest; 4 | 5 | import com.mogoweb.chrome.shell.ShellActivity; 6 | 7 | public class WebViewShellUrlTest extends WebViewShellTestBase { 8 | // URL used for base tests. 9 | private static final String URL = "data:text"; 10 | 11 | @SmallTest 12 | public void testBaseStartup() throws InterruptedException { 13 | ShellActivity activity = launchWebViewShellWithUrl(URL); 14 | waitForActiveShellToBeDoneLoading(); 15 | 16 | // Make sure the activity was created as expected. 17 | assertNotNull(activity); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/DisabledTest.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * This annotation is for disabled tests. 14 | *

15 | * Tests with this annotation will not be run on any of the normal bots. 16 | * Please note that they might eventually run on a special bot. 17 | */ 18 | @Target(ElementType.METHOD) 19 | @Retention(RetentionPolicy.RUNTIME) 20 | public @interface DisabledTest { 21 | } 22 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/EnormousTest.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * This annotation is for enormous tests. 14 | *

15 | * Examples of enormous tests are tests that depend on external web sites or 16 | * tests that are long running. 17 | *

18 | * Such tests are likely NOT reliable enough to run on tree closing bots and 19 | * should only be run on FYI bots. 20 | */ 21 | @Target(ElementType.METHOD) 22 | @Retention(RetentionPolicy.RUNTIME) 23 | public @interface EnormousTest { 24 | } 25 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/Feature.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * The java instrumentation tests are normally fairly large (in terms of 14 | * dependencies), and the test suite ends up containing a large amount of 15 | * tests that are not trivial to filter / group just by their names. 16 | * Instead, we use this annotation: each test should be annotated as: 17 | * @Feature({"Foo", "Bar"}) 18 | * in order for the test runner scripts to be able to filter and group 19 | * them accordingly (for instance, this enable us to run all tests that exercise 20 | * feature Foo). 21 | */ 22 | @Target(ElementType.METHOD) 23 | @Retention(RetentionPolicy.RUNTIME) 24 | public @interface Feature { 25 | /** 26 | * @return A list of feature names. 27 | */ 28 | public String[] value(); 29 | } 30 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/HostDrivenTest.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * This annotation is for host-driven tests. 14 | *

15 | * Tests with these annotations are run explicitly by HostDrivenTestCase-derived 16 | * python tests on the host and are excluded from regular instrumentation test runs. 17 | *

18 | */ 19 | @Target(ElementType.METHOD) 20 | @Retention(RetentionPolicy.RUNTIME) 21 | public @interface HostDrivenTest { 22 | } 23 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/InstrumentationUtils.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import android.app.Instrumentation; 8 | 9 | import java.util.concurrent.Callable; 10 | import java.util.concurrent.ExecutionException; 11 | import java.util.concurrent.FutureTask; 12 | 13 | /** 14 | * Utility methods built around the android.app.Instrumentation class. 15 | */ 16 | public final class InstrumentationUtils { 17 | 18 | private InstrumentationUtils() { 19 | } 20 | 21 | public static R runOnMainSyncAndGetResult(Instrumentation instrumentation, 22 | Callable callable) throws Throwable { 23 | FutureTask task = new FutureTask(callable); 24 | instrumentation.runOnMainSync(task); 25 | try { 26 | return task.get(); 27 | } catch (ExecutionException e) { 28 | // Unwrap the cause of the exception and re-throw it. 29 | throw e.getCause(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/PhoneOnly.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * Annotation for specifying that the test should only be run on phones. 14 | */ 15 | @Target(ElementType.METHOD) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | public @interface PhoneOnly { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/Restriction.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * An annotation for listing restrictions for a test method. For example, if a test method is only 14 | * applicable on a phone with small memory: 15 | * @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_SMALL_MEMORY}) 16 | * Test classes are free to define restrictions and enforce them using reflection at runtime. 17 | */ 18 | @Target(ElementType.METHOD) 19 | @Retention(RetentionPolicy.RUNTIME) 20 | public @interface Restriction { 21 | /** Specifies the test is only valid on phone form factors. */ 22 | public static final String RESTRICTION_TYPE_PHONE = "Phone"; 23 | 24 | /** Specifies the test is only valid on tablet form factors. */ 25 | public static final String RESTRICTION_TYPE_TABLET = "Tablet"; 26 | 27 | /** Specifies the test is only valid on low end devices that have less memory. */ 28 | public static final String RESTRICTION_TYPE_LOW_END_DEVICE = "Low_End_Device"; 29 | 30 | /** Specifies the test is only valid on non-low end devices. */ 31 | public static final String RESTRICTION_TYPE_NON_LOW_END_DEVICE = "Non_Low_End_Device"; 32 | 33 | /** 34 | * @return A list of restrictions. 35 | */ 36 | public String[] value(); 37 | } -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/ScalableTimeout.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | /** 8 | * Utility class for scaling various timeouts by a common factor. 9 | * For example, to run tests under Valgrind, you might want the following: 10 | * adb shell "echo 20.0 > /data/local/tmp/chrome_timeout_scale" 11 | */ 12 | public class ScalableTimeout { 13 | private static Double sTimeoutScale = null; 14 | private static final String PROPERTY_FILE = "/data/local/tmp/chrome_timeout_scale"; 15 | 16 | public static long scaleTimeout(long timeout) { 17 | if (sTimeoutScale == null) { 18 | try { 19 | char[] data = TestFileUtil.readUtf8File(PROPERTY_FILE, 32); 20 | sTimeoutScale = Double.parseDouble(new String(data)); 21 | } catch (Exception e) { 22 | // NumberFormatException, FileNotFoundException, IOException 23 | sTimeoutScale = 1.0; 24 | } 25 | } 26 | return (long)(timeout * sTimeoutScale); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/TabletOnly.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * Annotation for specifying that the test should only be run on tablets. 14 | */ 15 | @Target(ElementType.METHOD) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | public @interface TabletOnly { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/base/test/util/TimeoutScale.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.base.test.util; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | /** 13 | * This annotation can be used to scale a specific test timeout. 14 | */ 15 | @Target(ElementType.METHOD) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | public @interface TimeoutScale { 18 | /** 19 | * @return A number to scale the test timeout. 20 | */ 21 | public int value(); 22 | } 23 | -------------------------------------------------------------------------------- /testshell/javatests/src/org/chromium/content/browser/test/util/Criteria.java: -------------------------------------------------------------------------------- 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 3 | // found in the LICENSE file. 4 | 5 | package org.chromium.content.browser.test.util; 6 | 7 | /** 8 | * Provides a means for validating whether some condition/criteria has been met. 9 | */ 10 | public interface Criteria { 11 | 12 | /** 13 | * @return Whether the criteria this is testing has been satisfied. 14 | */ 15 | public boolean isSatisfied(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tools/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (c) 2013 mogoweb. All rights reserved. 4 | # Copyright (c) 2013 Intel Corporation. All rights reserved. 5 | # Use of this source code is governed by a BSD-style license that can be 6 | # found in the LICENSE file. 7 | 8 | ''' This script provides utils for python scripts in mogo. 9 | ''' 10 | 11 | import os 12 | import sys 13 | import subprocess 14 | 15 | def TryAddDepotToolsToPythonPath(): 16 | depot_tools = FindDepotToolsInPath() 17 | if depot_tools: 18 | sys.path.append(depot_tools) 19 | python_path = os.environ.get('PYTHONPATH') 20 | if python_path: 21 | os.environ['PYTHONPATH'] = os.path.pathsep.join( 22 | python_path.split(os.path.pathsep)+[depot_tools]) 23 | else: 24 | os.environ['PYTHONPATH'] = depot_tools 25 | 26 | def FindDepotToolsInPath(): 27 | paths = os.getenv('PATH').split(os.path.pathsep) 28 | for path in paths: 29 | if os.path.basename(path) == '': 30 | # path is end with os.path.pathsep 31 | path = os.path.dirname(path) 32 | if os.path.basename(path) == 'depot_tools': 33 | return path 34 | return None 35 | 36 | def IsWindows(): 37 | return sys.platform == 'cygwin' or sys.platform.startswith('win') 38 | 39 | def IsLinux(): 40 | return sys.platform.startswith('linux') 41 | 42 | def IsMac(): 43 | return sys.platform.startswith('darwin') 44 | 45 | def GitExe(): 46 | if IsWindows(): 47 | return 'git.bat' 48 | else: 49 | return 'git' 50 | 51 | def GetCommandOutput(command, cwd=None): 52 | proc = subprocess.Popen(command, stdout=subprocess.PIPE, 53 | stderr=subprocess.STDOUT, bufsize=1, 54 | cwd=cwd) 55 | output = proc.communicate()[0] 56 | result = proc.returncode 57 | if result: 58 | raise Exception('%s: %s' % (subprocess.list2cmdline(command), output)) 59 | return output --------------------------------------------------------------------------------