Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| index f1f4805fc356e796e96ed8463edd0b8b79048674..9a39fcc170994f9159c8a7814f167776ce352a30 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| @@ -1720,13 +1720,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| builder.show(); |
| } |
| } else if (id == R.id.help_id) { |
| - // Since reading back the compositor is asynchronous, we need to do the readback |
| - // before starting the GoogleHelp. |
| - String helpContextId = HelpAndFeedback.getHelpContextIdFromUrl( |
| - this, currentTab.getUrl(), getCurrentTabModel().isIncognito()); |
| - HelpAndFeedback.getInstance(this) |
| - .show(this, helpContextId, currentTab.getProfile(), currentTab.getUrl()); |
| - RecordUserAction.record("MobileMenuFeedback"); |
| + startHelpAndFeedback(currentTab, "MobileMenuFeedback"); |
| } else { |
| return false; |
| } |
| @@ -1734,6 +1728,21 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| } |
| /** |
| + * Shows HelpAndFeedback and records the user action as well. |
| + * @param currentTab The tab that the user is currently on. Assumes it cannot be null |
|
Theresa
2016/12/01 16:21:21
Typically we annotate parameters that may be null
JJ
2016/12/01 17:54:41
Ah, so in this case I can remove it and don't have
|
| + * @param recordAction The label we use to record the user action. |
|
Theresa
2016/12/01 16:21:21
nit: "The user action to record"?
JJ
2016/12/01 17:54:41
Done.
|
| + */ |
| + public void startHelpAndFeedback(Tab currentTab, String recordAction) { |
|
Theresa
2016/12/01 16:21:21
I like the introduction of this helper method.
JJ
2016/12/01 17:54:41
c:
|
| + // Since reading back the compositor is asynchronous, we need to do the readback |
| + // before starting the GoogleHelp. |
| + String helpContextId = HelpAndFeedback.getHelpContextIdFromUrl( |
| + this, currentTab.getUrl(), getCurrentTabModel().isIncognito()); |
| + HelpAndFeedback.getInstance(this) |
| + .show(this, helpContextId, currentTab.getProfile(), currentTab.getUrl()); |
| + RecordUserAction.record(recordAction); |
| + } |
| + |
| + /** |
| * Tests if VR Shell (the mode displaying browser UI and tab contents in VR) is currently |
| * enabled. |
| */ |