{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments/69144347","id":69144347,"diff_hunk":"@@ -183,13 +200,21 @@ static String getParametersString(Map<String, String> parametersMap) {\n     return resultBuilder.toString();\n   }\n \n-  public static void showOptInDialog() {\n+  /**\n+   * @param parentShell if null, shows the dialog at the workbench level.\n+   */\n+  public static void showOptInDialog(Shell parentShell) {\n     if (!hasUserOptedIn() && !hasUserRegisteredOptInStatus()) {\n-      IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();\n-      if (window != null) {\n-        new OptInDialog(window.getShell()).open();\n+      if (parentShell != null) {","path":"plugins/com.google.cloud.tools.eclipse.usagetracker/src/com/google/cloud/tools/eclipse/usagetracker/AnalyticsPingManager.java","position":49,"original_position":49,"commit_id":"7d6b4339cd1424b7fa28d65e1e53dee0230626f8","original_commit_id":"7d6b4339cd1424b7fa28d65e1e53dee0230626f8","user":{"login":"briandealwis","id":202851,"avatar_url":"https://avatars.githubusercontent.com/u/202851?v=3","gravatar_id":"","url":"https://api.github.com/users/briandealwis","html_url":"https://github.com/briandealwis","followers_url":"https://api.github.com/users/briandealwis/followers","following_url":"https://api.github.com/users/briandealwis/following{/other_user}","gists_url":"https://api.github.com/users/briandealwis/gists{/gist_id}","starred_url":"https://api.github.com/users/briandealwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandealwis/subscriptions","organizations_url":"https://api.github.com/users/briandealwis/orgs","repos_url":"https://api.github.com/users/briandealwis/repos","events_url":"https://api.github.com/users/briandealwis/events{/privacy}","received_events_url":"https://api.github.com/users/briandealwis/received_events","type":"User","site_admin":false},"body":"I would move this logic into `findShell(parentShell)`.  `findShell(parentShell)` would:\r\n  - return `parentShell` if not null\r\n  - look for the active workbench window and return its window\r\n  - look for `Display.getCurrent().getActiveShell()` providing there's a Display\r\n  - return null\r\n\r\n`null` is a valid parent shell: it just means the dialog is un-parented.","created_at":"2016-06-30T14:39:32Z","updated_at":"2016-06-30T14:39:32Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/309#discussion_r69144347","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments/69144347"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/309#discussion_r69144347"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309","id":75733297,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/309","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/309.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/309.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/309","number":309,"state":"open","locked":false,"title":"sendPing() triggers showing opt-in dialog","user":{"login":"chanseokoh","id":10523105,"avatar_url":"https://avatars.githubusercontent.com/u/10523105?v=3","gravatar_id":"","url":"https://api.github.com/users/chanseokoh","html_url":"https://github.com/chanseokoh","followers_url":"https://api.github.com/users/chanseokoh/followers","following_url":"https://api.github.com/users/chanseokoh/following{/other_user}","gists_url":"https://api.github.com/users/chanseokoh/gists{/gist_id}","starred_url":"https://api.github.com/users/chanseokoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chanseokoh/subscriptions","organizations_url":"https://api.github.com/users/chanseokoh/orgs","repos_url":"https://api.github.com/users/chanseokoh/repos","events_url":"https://api.github.com/users/chanseokoh/events{/privacy}","received_events_url":"https://api.github.com/users/chanseokoh/received_events","type":"User","site_admin":false},"body":"Two enhancements:\r\n\r\n- `sendPing()` will show the opt-in dialog (only once) if needed.\r\n- Allows a `sendPing()` caller to set the parent shell of the opt-in dialog.","created_at":"2016-06-29T22:34:25Z","updated_at":"2016-06-30T14:39:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4bee08ea31c6a437d8f1e41f91b156868ac1645","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/309/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/7d6b4339cd1424b7fa28d65e1e53dee0230626f8","head":{"label":"GoogleCloudPlatform:show-analytics-opt-in-dialog","ref":"show-analytics-opt-in-dialog","sha":"7d6b4339cd1424b7fa28d65e1e53dee0230626f8","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":53369484,"name":"gcloud-eclipse-tools","full_name":"GoogleCloudPlatform/gcloud-eclipse-tools","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","description":"Google Cloud Platform plugin for Eclipse","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/deployments","created_at":"2016-03-08T00:30:03Z","updated_at":"2016-06-14T19:37:54Z","pushed_at":"2016-06-30T14:38:43Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-eclipse-tools.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","homepage":"","size":2380,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":81,"forks":1,"open_issues":81,"watchers":6,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"e029ae867fb4c9e1d3e6a2718ce973e746ea08cc","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":53369484,"name":"gcloud-eclipse-tools","full_name":"GoogleCloudPlatform/gcloud-eclipse-tools","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","description":"Google Cloud Platform plugin for Eclipse","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/deployments","created_at":"2016-03-08T00:30:03Z","updated_at":"2016-06-14T19:37:54Z","pushed_at":"2016-06-30T14:38:43Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-eclipse-tools.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","homepage":"","size":2380,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":81,"forks":1,"open_issues":81,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/309"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/309"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/309/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/309/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/7d6b4339cd1424b7fa28d65e1e53dee0230626f8"}}}}
{"actor":{"display_login":"briandealwis"}}