Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1548)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java

Issue 282813002: Show logs in english in TracingController for adb_chrome_profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
index 172a016e3c00baa2f81b5eb216249889d79529d1..b89205c7a688230a9fdc5c9e38f97c400ceb3c39 100644
--- a/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
+++ b/content/public/android/java/src/org/chromium/content/browser/TracingControllerAndroid.java
@@ -53,6 +53,11 @@ public class TracingControllerAndroid {
private static final String DEFAULT_CHROME_CATEGORIES_PLACE_HOLDER =
"_DEFAULT_CHROME_CATEGORIES";
+ // These strings must match the ones expected by adb_profile_chrome.
+ private static final String PROFILER_STARTED_FMT = "Profiler started: %s";
+ private static final String PROFILER_FINISHED_FMT =
+ "Profiler finished. Results are in %s.";
+
private final Context mContext;
private final TracingBroadcastReceiver mBroadcastReceiver;
private final TracingIntentFilter mIntentFilter;
@@ -191,7 +196,8 @@ public class TracingControllerAndroid {
return false;
}
- logAndToastInfo(mContext.getString(R.string.profiler_started_toast) + ": " + categories);
+ logForProfiler(String.format(PROFILER_STARTED_FMT, categories));
+ showToast(mContext.getString(R.string.profiler_started_toast) + ": " + categories);
mFilename = filename;
mIsTracing = true;
return true;
@@ -217,8 +223,8 @@ public class TracingControllerAndroid {
return;
}
- logAndToastInfo(
- mContext.getString(R.string.profiler_stopped_toast, mFilename));
+ logForProfiler(String.format(PROFILER_FINISHED_FMT, mFilename));
+ showToast(mContext.getString(R.string.profiler_stopped_toast, mFilename));
mIsTracing = false;
mFilename = null;
}
@@ -242,13 +248,17 @@ public class TracingControllerAndroid {
}
}
- void logAndToastError(String str) {
+ private void logAndToastError(String str) {
Log.e(TAG, str);
if (mShowToasts) Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show();
}
- void logAndToastInfo(String str) {
+ // The |str| string needs to match the ones that adb_chrome_profiler looks for.
+ private void logForProfiler(String str) {
Log.i(TAG, str);
+ }
+
+ private void showToast(String str) {
if (mShowToasts) Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698