{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments/189937282","pull_request_review_id":122208450,"id":189937282,"diff_hunk":"@@ -22,16 +25,29 @@ import org.mozilla.geckoview.GeckoRuntime\n  * Helper class for lazily instantiating components needed by the application.\n  */\n class Components(private val applicationContext: Context) {\n+    // Engine\n     private val geckoRuntime by lazy {\n         GeckoRuntime.getDefault(applicationContext)\n     }\n     val engine : Engine by lazy { GeckoEngine(geckoRuntime) }\n-    // val engine : Engine by lazy { SystemEngine() }\n \n+    // Session\n     val sessionProvider = SessionProvider(Session(\"https://www.mozilla.org\"), DefaultSessionStorage(applicationContext))\n     val sessionUseCases = SessionUseCases(sessionProvider, engine)\n     val sessionIntentProcessor = SessionIntentProcessor(sessionUseCases)\n \n+    // Search\n+    private val searchEngineManager by lazy {\n+        val manager = SearchEngineManager()\n+        async {\n+            manager.load(applicationContext)\n+        }\n+        manager\n+    }","path":"samples/browser/src/main/java/org/mozilla/samples/browser/Components.kt","position":39,"original_position":39,"commit_id":"034f8298eedafbea78d886e41dc6a96bef2bd49a","original_commit_id":"034f8298eedafbea78d886e41dc6a96bef2bd49a","user":{"login":"pocmo","id":89638,"avatar_url":"https://avatars0.githubusercontent.com/u/89638?v=4","gravatar_id":"","url":"https://api.github.com/users/pocmo","html_url":"https://github.com/pocmo","followers_url":"https://api.github.com/users/pocmo/followers","following_url":"https://api.github.com/users/pocmo/following{/other_user}","gists_url":"https://api.github.com/users/pocmo/gists{/gist_id}","starred_url":"https://api.github.com/users/pocmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocmo/subscriptions","organizations_url":"https://api.github.com/users/pocmo/orgs","repos_url":"https://api.github.com/users/pocmo/repos","events_url":"https://api.github.com/users/pocmo/events{/privacy}","received_events_url":"https://api.github.com/users/pocmo/received_events","type":"User","site_admin":false},"body":"Another option without the last line may be:\r\n\r\n```Kotlin\r\n    private val searchEngineManager by lazy {\r\n        SearchEngineManager().apply {\r\n            async { load(applicationContext) }\r\n        }\r\n   }\r\n```","created_at":"2018-05-22T15:05:09Z","updated_at":"2018-05-22T15:12:09Z","html_url":"https://github.com/mozilla-mobile/android-components/pull/199#discussion_r189937282","pull_request_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments/189937282"},"html":{"href":"https://github.com/mozilla-mobile/android-components/pull/199#discussion_r189937282"},"pull_request":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199","id":189520820,"html_url":"https://github.com/mozilla-mobile/android-components/pull/199","diff_url":"https://github.com/mozilla-mobile/android-components/pull/199.diff","patch_url":"https://github.com/mozilla-mobile/android-components/pull/199.patch","issue_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/199","number":199,"state":"open","locked":false,"title":"Closes #92: Perform search via default search provider","user":{"login":"csadilek","id":472523,"avatar_url":"https://avatars1.githubusercontent.com/u/472523?v=4","gravatar_id":"","url":"https://api.github.com/users/csadilek","html_url":"https://github.com/csadilek","followers_url":"https://api.github.com/users/csadilek/followers","following_url":"https://api.github.com/users/csadilek/following{/other_user}","gists_url":"https://api.github.com/users/csadilek/gists{/gist_id}","starred_url":"https://api.github.com/users/csadilek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csadilek/subscriptions","organizations_url":"https://api.github.com/users/csadilek/orgs","repos_url":"https://api.github.com/users/csadilek/repos","events_url":"https://api.github.com/users/csadilek/events{/privacy}","received_events_url":"https://api.github.com/users/csadilek/received_events","type":"User","site_admin":false},"body":"I think this covers the basic functionality for #92. Worth taking a look before we go deeper ;).\r\n\r\n- Introduces a new feature-search module which contains the use case\r\n- Makes sure searching and therefore the feature dependency is optional\r\n- Stores the search terms in the session\r\n- Resurfaces the search terms in edit mode if a search is active\r\n- Adds a String extension to check if a String is a URL","created_at":"2018-05-22T00:34:11Z","updated_at":"2018-05-22T15:12:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ba7c93f28ed4073cebbba3e993c6ffdb7859193","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199/commits","review_comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199/comments","review_comment_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/199/comments","statuses_url":"https://api.github.com/repos/mozilla-mobile/android-components/statuses/034f8298eedafbea78d886e41dc6a96bef2bd49a","head":{"label":"csadilek:issue-92","ref":"issue-92","sha":"034f8298eedafbea78d886e41dc6a96bef2bd49a","user":{"login":"csadilek","id":472523,"avatar_url":"https://avatars1.githubusercontent.com/u/472523?v=4","gravatar_id":"","url":"https://api.github.com/users/csadilek","html_url":"https://github.com/csadilek","followers_url":"https://api.github.com/users/csadilek/followers","following_url":"https://api.github.com/users/csadilek/following{/other_user}","gists_url":"https://api.github.com/users/csadilek/gists{/gist_id}","starred_url":"https://api.github.com/users/csadilek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csadilek/subscriptions","organizations_url":"https://api.github.com/users/csadilek/orgs","repos_url":"https://api.github.com/users/csadilek/repos","events_url":"https://api.github.com/users/csadilek/events{/privacy}","received_events_url":"https://api.github.com/users/csadilek/received_events","type":"User","site_admin":false},"repo":{"id":126226751,"name":"android-components","full_name":"csadilek/android-components","owner":{"login":"csadilek","id":472523,"avatar_url":"https://avatars1.githubusercontent.com/u/472523?v=4","gravatar_id":"","url":"https://api.github.com/users/csadilek","html_url":"https://github.com/csadilek","followers_url":"https://api.github.com/users/csadilek/followers","following_url":"https://api.github.com/users/csadilek/following{/other_user}","gists_url":"https://api.github.com/users/csadilek/gists{/gist_id}","starred_url":"https://api.github.com/users/csadilek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csadilek/subscriptions","organizations_url":"https://api.github.com/users/csadilek/orgs","repos_url":"https://api.github.com/users/csadilek/repos","events_url":"https://api.github.com/users/csadilek/events{/privacy}","received_events_url":"https://api.github.com/users/csadilek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csadilek/android-components","description":null,"fork":true,"url":"https://api.github.com/repos/csadilek/android-components","forks_url":"https://api.github.com/repos/csadilek/android-components/forks","keys_url":"https://api.github.com/repos/csadilek/android-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csadilek/android-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csadilek/android-components/teams","hooks_url":"https://api.github.com/repos/csadilek/android-components/hooks","issue_events_url":"https://api.github.com/repos/csadilek/android-components/issues/events{/number}","events_url":"https://api.github.com/repos/csadilek/android-components/events","assignees_url":"https://api.github.com/repos/csadilek/android-components/assignees{/user}","branches_url":"https://api.github.com/repos/csadilek/android-components/branches{/branch}","tags_url":"https://api.github.com/repos/csadilek/android-components/tags","blobs_url":"https://api.github.com/repos/csadilek/android-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csadilek/android-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csadilek/android-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/csadilek/android-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csadilek/android-components/statuses/{sha}","languages_url":"https://api.github.com/repos/csadilek/android-components/languages","stargazers_url":"https://api.github.com/repos/csadilek/android-components/stargazers","contributors_url":"https://api.github.com/repos/csadilek/android-components/contributors","subscribers_url":"https://api.github.com/repos/csadilek/android-components/subscribers","subscription_url":"https://api.github.com/repos/csadilek/android-components/subscription","commits_url":"https://api.github.com/repos/csadilek/android-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/csadilek/android-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/csadilek/android-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/csadilek/android-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/csadilek/android-components/contents/{+path}","compare_url":"https://api.github.com/repos/csadilek/android-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csadilek/android-components/merges","archive_url":"https://api.github.com/repos/csadilek/android-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csadilek/android-components/downloads","issues_url":"https://api.github.com/repos/csadilek/android-components/issues{/number}","pulls_url":"https://api.github.com/repos/csadilek/android-components/pulls{/number}","milestones_url":"https://api.github.com/repos/csadilek/android-components/milestones{/number}","notifications_url":"https://api.github.com/repos/csadilek/android-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csadilek/android-components/labels{/name}","releases_url":"https://api.github.com/repos/csadilek/android-components/releases{/id}","deployments_url":"https://api.github.com/repos/csadilek/android-components/deployments","created_at":"2018-03-21T18:56:59Z","updated_at":"2018-05-10T20:47:26Z","pushed_at":"2018-05-22T14:53:03Z","git_url":"git://github.com/csadilek/android-components.git","ssh_url":"git@github.com:csadilek/android-components.git","clone_url":"https://github.com/csadilek/android-components.git","svn_url":"https://github.com/csadilek/android-components","homepage":null,"size":1288,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-mobile:master","ref":"master","sha":"9db2cc19f418e5fae3bf21750503e1785878bea6","user":{"login":"mozilla-mobile","id":22351667,"avatar_url":"https://avatars3.githubusercontent.com/u/22351667?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":126199585,"name":"android-components","full_name":"mozilla-mobile/android-components","owner":{"login":"mozilla-mobile","id":22351667,"avatar_url":"https://avatars3.githubusercontent.com/u/22351667?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla-mobile","html_url":"https://github.com/mozilla-mobile","followers_url":"https://api.github.com/users/mozilla-mobile/followers","following_url":"https://api.github.com/users/mozilla-mobile/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-mobile/subscriptions","organizations_url":"https://api.github.com/users/mozilla-mobile/orgs","repos_url":"https://api.github.com/users/mozilla-mobile/repos","events_url":"https://api.github.com/users/mozilla-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-mobile/android-components","description":"A collection of Android libraries to build browsers or browser-like applications.","fork":false,"url":"https://api.github.com/repos/mozilla-mobile/android-components","forks_url":"https://api.github.com/repos/mozilla-mobile/android-components/forks","keys_url":"https://api.github.com/repos/mozilla-mobile/android-components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-mobile/android-components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-mobile/android-components/teams","hooks_url":"https://api.github.com/repos/mozilla-mobile/android-components/hooks","issue_events_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-mobile/android-components/events","assignees_url":"https://api.github.com/repos/mozilla-mobile/android-components/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-mobile/android-components/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-mobile/android-components/tags","blobs_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-mobile/android-components/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-mobile/android-components/languages","stargazers_url":"https://api.github.com/repos/mozilla-mobile/android-components/stargazers","contributors_url":"https://api.github.com/repos/mozilla-mobile/android-components/contributors","subscribers_url":"https://api.github.com/repos/mozilla-mobile/android-components/subscribers","subscription_url":"https://api.github.com/repos/mozilla-mobile/android-components/subscription","commits_url":"https://api.github.com/repos/mozilla-mobile/android-components/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-mobile/android-components/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-mobile/android-components/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-mobile/android-components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-mobile/android-components/merges","archive_url":"https://api.github.com/repos/mozilla-mobile/android-components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-mobile/android-components/downloads","issues_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-mobile/android-components/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-mobile/android-components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-mobile/android-components/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-mobile/android-components/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-mobile/android-components/deployments","created_at":"2018-03-21T15:24:03Z","updated_at":"2018-05-22T14:55:00Z","pushed_at":"2018-05-22T14:53:04Z","git_url":"git://github.com/mozilla-mobile/android-components.git","ssh_url":"git@github.com:mozilla-mobile/android-components.git","clone_url":"https://github.com/mozilla-mobile/android-components.git","svn_url":"https://github.com/mozilla-mobile/android-components","homepage":"","size":1069,"stargazers_count":16,"watchers_count":16,"language":"Kotlin","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":64,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":8,"open_issues":64,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199"},"html":{"href":"https://github.com/mozilla-mobile/android-components/pull/199"},"issue":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/issues/199"},"comments":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/issues/199/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/199/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-mobile/android-components/statuses/034f8298eedafbea78d886e41dc6a96bef2bd49a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pocmo"}}