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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java

Issue 2548013002: Remove redundant field initialization in Java code. (Closed)
Patch Set: rebase Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 8
9 import org.chromium.base.annotations.CalledByNative; 9 import org.chromium.base.annotations.CalledByNative;
10 import org.chromium.base.annotations.JNINamespace; 10 import org.chromium.base.annotations.JNINamespace;
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 private static void ensureContentRegistrarsAreRegistered() { 43 private static void ensureContentRegistrarsAreRegistered() {
44 if (sHasRegisteredRegistrars) return; 44 if (sHasRegisteredRegistrars) return;
45 sHasRegisteredRegistrars = true; 45 sHasRegisteredRegistrars = true;
46 InterfaceRegistrar.Registry.addContextRegistrar(new ContentContextInterf aceRegistrar()); 46 InterfaceRegistrar.Registry.addContextRegistrar(new ContentContextInterf aceRegistrar());
47 InterfaceRegistrar.Registry.addWebContentsRegistrar( 47 InterfaceRegistrar.Registry.addWebContentsRegistrar(
48 new ContentWebContentsInterfaceRegistrar()); 48 new ContentWebContentsInterfaceRegistrar());
49 } 49 }
50 50
51 private static boolean sHasRegisteredRegistrars = false; 51 private static boolean sHasRegisteredRegistrars;
52 } 52 }
53 53
54 class ContentContextInterfaceRegistrar implements InterfaceRegistrar<Context> { 54 class ContentContextInterfaceRegistrar implements InterfaceRegistrar<Context> {
55 @Override 55 @Override
56 public void registerInterfaces(InterfaceRegistry registry, final Context app licationContext) { 56 public void registerInterfaces(InterfaceRegistry registry, final Context app licationContext) {
57 registry.addInterface( 57 registry.addInterface(
58 VibrationManager.MANAGER, new VibrationManagerImpl.Factory(appli cationContext)); 58 VibrationManager.MANAGER, new VibrationManagerImpl.Factory(appli cationContext));
59 registry.addInterface( 59 registry.addInterface(
60 BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicationCon text)); 60 BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicationCon text));
61 registry.addInterface( 61 registry.addInterface(
62 FaceDetection.MANAGER, new FaceDetectionFactory(applicationConte xt)); 62 FaceDetection.MANAGER, new FaceDetectionFactory(applicationConte xt));
63 // TODO(avayvod): Register the PresentationService implementation here. 63 // TODO(avayvod): Register the PresentationService implementation here.
64 } 64 }
65 } 65 }
66 66
67 class ContentWebContentsInterfaceRegistrar implements InterfaceRegistrar<WebCont ents> { 67 class ContentWebContentsInterfaceRegistrar implements InterfaceRegistrar<WebCont ents> {
68 @Override 68 @Override
69 public void registerInterfaces(InterfaceRegistry registry, final WebContents webContents) { 69 public void registerInterfaces(InterfaceRegistry registry, final WebContents webContents) {
70 registry.addInterface(Nfc.MANAGER, new NfcFactory(webContents)); 70 registry.addInterface(Nfc.MANAGER, new NfcFactory(webContents));
71 } 71 }
72 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698