OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.chromoting; | 5 package org.chromium.chromoting; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
9 import android.util.Log; | 9 import android.util.Log; |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 */ | 79 */ |
80 public ActivityLifecycleListener onActivityAcceptingListener( | 80 public ActivityLifecycleListener onActivityAcceptingListener( |
81 Activity activity, String capability) { | 81 Activity activity, String capability) { |
82 | 82 |
83 ActivityLifecycleListener listener; | 83 ActivityLifecycleListener listener; |
84 | 84 |
85 if (isCapabilityEnabled(capability)) { | 85 if (isCapabilityEnabled(capability)) { |
86 for (ClientExtension ext : mClientExtensions) { | 86 for (ClientExtension ext : mClientExtensions) { |
87 if (ext.getCapability().equals(capability)) { | 87 if (ext.getCapability().equals(capability)) { |
88 listener = ext.onActivityAcceptingListener(activity); | 88 listener = ext.onActivityAcceptingListener(activity); |
89 if (listener != null) | 89 if (listener != null) return listener; |
90 return listener; | |
91 } | 90 } |
92 } | 91 } |
93 } | 92 } |
94 | 93 |
95 return new DummyActivityLifecycleListener(); | 94 return new DummyActivityLifecycleListener(); |
96 } | 95 } |
97 | 96 |
98 /** | 97 /** |
99 * Receives the capabilities negotiated between client and host and creates
the appropriate | 98 * Receives the capabilities negotiated between client and host and creates
the appropriate |
100 * extension handlers. | 99 * extension handlers. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return new DummyClientExtension(); | 147 return new DummyClientExtension(); |
149 } catch (InstantiationException e) { | 148 } catch (InstantiationException e) { |
150 Log.w("CapabilityManager", "Failed to create CastExtensionHandler.")
; | 149 Log.w("CapabilityManager", "Failed to create CastExtensionHandler.")
; |
151 return new DummyClientExtension(); | 150 return new DummyClientExtension(); |
152 } catch (IllegalAccessException e) { | 151 } catch (IllegalAccessException e) { |
153 Log.w("CapabilityManager", "Failed to create CastExtensionHandler.")
; | 152 Log.w("CapabilityManager", "Failed to create CastExtensionHandler.")
; |
154 return new DummyClientExtension(); | 153 return new DummyClientExtension(); |
155 } | 154 } |
156 } | 155 } |
157 } | 156 } |
OLD | NEW |