| 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 #include "media/midi/midi_manager_android.h" | 5 #include "media/midi/midi_manager_android.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/android/context_utils.h" | 8 #include "base/android/context_utils.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 void MidiManagerAndroid::OnInitialized( | 102 void MidiManagerAndroid::OnInitialized( |
| 103 JNIEnv* env, | 103 JNIEnv* env, |
| 104 const JavaParamRef<jobject>& caller, | 104 const JavaParamRef<jobject>& caller, |
| 105 const JavaParamRef<jobjectArray>& devices) { | 105 const JavaParamRef<jobjectArray>& devices) { |
| 106 jsize length = env->GetArrayLength(devices); | 106 jsize length = env->GetArrayLength(devices); |
| 107 | 107 |
| 108 for (jsize i = 0; i < length; ++i) { | 108 for (jsize i = 0; i < length; ++i) { |
| 109 jobject raw_device = env->GetObjectArrayElement(devices, i); | 109 jobject raw_device = env->GetObjectArrayElement(devices, i); |
| 110 AddDevice(base::MakeUnique<MidiDeviceAndroid>(env, raw_device, this)); | 110 AddDevice(base::MakeUnique<MidiDeviceAndroid>(env, raw_device, this)); |
| 111 } | 111 } |
| 112 CompleteInitialization(Result::OK); | 112 CompleteInitialization(mojom::Result::OK); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void MidiManagerAndroid::OnInitializationFailed( | 115 void MidiManagerAndroid::OnInitializationFailed( |
| 116 JNIEnv* env, | 116 JNIEnv* env, |
| 117 const JavaParamRef<jobject>& caller) { | 117 const JavaParamRef<jobject>& caller) { |
| 118 CompleteInitialization(Result::INITIALIZATION_ERROR); | 118 CompleteInitialization(mojom::Result::INITIALIZATION_ERROR); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void MidiManagerAndroid::OnAttached(JNIEnv* env, | 121 void MidiManagerAndroid::OnAttached(JNIEnv* env, |
| 122 const JavaParamRef<jobject>& caller, | 122 const JavaParamRef<jobject>& caller, |
| 123 const JavaParamRef<jobject>& raw_device) { | 123 const JavaParamRef<jobject>& raw_device) { |
| 124 AddDevice(base::MakeUnique<MidiDeviceAndroid>(env, raw_device, this)); | 124 AddDevice(base::MakeUnique<MidiDeviceAndroid>(env, raw_device, this)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void MidiManagerAndroid::OnDetached(JNIEnv* env, | 127 void MidiManagerAndroid::OnDetached(JNIEnv* env, |
| 128 const JavaParamRef<jobject>& caller, | 128 const JavaParamRef<jobject>& caller, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 device->GetDeviceVersion(), MIDI_PORT_CONNECTED)); | 179 device->GetDeviceVersion(), MIDI_PORT_CONNECTED)); |
| 180 } | 180 } |
| 181 devices_.push_back(device.release()); | 181 devices_.push_back(device.release()); |
| 182 } | 182 } |
| 183 | 183 |
| 184 bool MidiManagerAndroid::Register(JNIEnv* env) { | 184 bool MidiManagerAndroid::Register(JNIEnv* env) { |
| 185 return RegisterNativesImpl(env); | 185 return RegisterNativesImpl(env); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace midi | 188 } // namespace midi |
| OLD | NEW |