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

Unified Diff: components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java

Issue 317713002: Address GCMDriver.java nits from crrev.com/312683004 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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: components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
diff --git a/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java b/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
index b931881ccd05b1d717bc008d0993371a890c400c..61964a077572ca5754123ecffe5b812004aabe18 100644
--- a/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
+++ b/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
@@ -20,7 +20,7 @@ import java.util.List;
@JNINamespace("gcm")
public final class GCMDriver {
private long mNativeGCMDriverAndroid;
- private Context mContext;
+ private final Context mContext;
private GCMDriver(long nativeGCMDriverAndroid, Context context) {
mNativeGCMDriverAndroid = nativeGCMDriverAndroid;
@@ -69,13 +69,16 @@ public final class GCMDriver {
}
public void onMessageReceived(String appId, Bundle extras) {
- String senderId = extras.getString("from");
- String collapseKey = extras.getString("collapse_key");
+ final String BUNDLE_SENDER_ID = "from";
+ final String BUNDLE_COLLAPSE_KEY = "collapse_key";
+
+ String senderId = extras.getString(BUNDLE_SENDER_ID);
+ String collapseKey = extras.getString(BUNDLE_COLLAPSE_KEY);
List<String> dataKeysAndValues = new ArrayList<String>();
for (String key : extras.keySet()) {
// TODO(johnme): Check there aren't other default keys that we need to exclude.
- if (key == "from" || key == "collapse_key")
+ if (key == BUNDLE_SENDER_ID || key == BUNDLE_COLLAPSE_KEY)
continue;
dataKeysAndValues.add(key);
dataKeysAndValues.add(extras.getString(key));
« 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