tree: d80144178319bba05a759ef1ea88f9448991c1c0 [path history] [tgz]
  1. interfaces/
  2. media/
  3. metrics/
  4. payments/
  5. permissions/
  6. resources/
  7. settings/
  8. test/
  9. test_interfaces/
  10. ActionModeCallback.java
  11. ApplicationInfoHelper.java
  12. AutocompleteSchemeClassifierImpl.java
  13. BrowserControlsContainerView.java
  14. BrowserFragmentImpl.java
  15. BrowserImpl.java
  16. BrowserList.java
  17. BrowserListObserver.java
  18. BrowserViewController.java
  19. ChildProcessServiceImpl.java
  20. ContactsPickerAdapter.java
  21. ContentViewRenderView.java
  22. ContentViewWithAutofill.java
  23. CookieManagerImpl.java
  24. CrashReporterControllerImpl.java
  25. DownloadCallbackProxy.java
  26. DownloadImpl.java
  27. ErrorPageCallbackProxy.java
  28. ExternalNavigationDelegateImpl.java
  29. FaviconCallbackProxy.java
  30. FragmentAndroidPermissionDelegate.java
  31. FragmentHostingRemoteFragmentImpl.java
  32. FragmentWindowAndroid.java
  33. FullscreenCallbackProxy.java
  34. FullscreenToast.java
  35. GmsBridge.java
  36. GmsBridgeImpl.java
  37. GoogleAccountAccessTokenFetcherProxy.java
  38. GoogleAccountsCallbackProxy.java
  39. HttpAuthHandlerImpl.java
  40. InfoBarContainer.java
  41. InfoBarContainerView.java
  42. InstalledAppProviderFactory.java
  43. IntentUtils.java
  44. InterceptNavigationDelegateClientImpl.java
  45. LocaleChangedBroadcastReceiver.java
  46. MojoInterfaceRegistrar.java
  47. NavigationControllerImpl.java
  48. NavigationImpl.java
  49. NewTabCallbackProxy.java
  50. OWNERS
  51. PageImpl.java
  52. PageInfoControllerDelegateImpl.java
  53. PrerenderControllerImpl.java
  54. ProfileImpl.java
  55. ProfileManager.java
  56. README.md
  57. RemoteFragmentImpl.java
  58. TabCallbackProxy.java
  59. TabImpl.java
  60. TranslateCompactInfoBar.java
  61. UrlBarControllerImpl.java
  62. WebappsHelper.java
  63. WebContentsGestureStateTracker.java
  64. WebLayerAccessibilityUtil.java
  65. WebLayerExceptionFilter.java
  66. WebLayerFactoryImpl.java
  67. WebLayerImpl.java
  68. WebLayerNotificationChannels.java
  69. WebLayerNotificationWrapperBuilder.java
  70. WebLayerTabModalPresenter.java
  71. WebMessageReplyProxyImpl.java
  72. WebShareServiceFactory.java
  73. WebViewCompatibilityHelperImpl.java
weblayer/browser/java/org/chromium/weblayer_private/README.md

Which Context should I use?

The code in this directory references different types of contexts. Please read about what each represents before deciding which one you should use.

Embedder's Activity Context

The fragment that WebLayer is loaded in holds a reference to the activity that it is currently attached to. This is what's referred to by mEmbedderActivityContext in BrowserImpl and BrowserFragmentImpl. It should be used to reference anything associated with the activity. For instance, embedder-specific resources, like Color resources which are resolved according to the theme of the embedding activity.

WebLayer's Activity Context

WebLayer has a lot of resources of its own which need to be accessed by the implementation code. We thus wrap the embedder‘s activity context so that resource and assert look-ups against the wrapped context go to the WebView or WebLayer support APK and not the embedder’s APK. This wrapped Context is what's returned by BrowserImpl.getContext(). Use this when referencing WebLayer specific resources. This is expected to be the most common use case.

Embedder's Application Context

Occasionally, we need the embedder‘s application context, as opposed to its activity context. For instance, fetching the current locale which applies to the entire application. Similar to WebLayer’s Activity Context, this context is also wrapped in our implementation so we can reference WebLayer-specific resources. This is what‘s returned by ContextUtils.getApplicationContext(). It shouldn’t be downcast to Application (or any subclass thereof) since it's wrapped in a ContextWrapper.