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 "components/gcm_driver/gcm_driver_android.h" | 5 #include "components/gcm_driver/gcm_driver_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 void GCMDriverAndroid::UpdateAccountMapping( | 147 void GCMDriverAndroid::UpdateAccountMapping( |
148 const AccountMapping& account_mapping) { | 148 const AccountMapping& account_mapping) { |
149 NOTIMPLEMENTED(); | 149 NOTIMPLEMENTED(); |
150 } | 150 } |
151 | 151 |
152 void GCMDriverAndroid::RemoveAccountMapping(const std::string& account_id) { | 152 void GCMDriverAndroid::RemoveAccountMapping(const std::string& account_id) { |
153 NOTIMPLEMENTED(); | 153 NOTIMPLEMENTED(); |
154 } | 154 } |
155 | 155 |
| 156 base::Time GCMDriverAndroid::GetLastTokenFetchTime() { |
| 157 NOTIMPLEMENTED(); |
| 158 return base::Time(); |
| 159 } |
| 160 |
| 161 void GCMDriverAndroid::SetLastTokenFetchTime(const base::Time& time) { |
| 162 NOTIMPLEMENTED(); |
| 163 } |
| 164 |
156 GCMClient::Result GCMDriverAndroid::EnsureStarted() { | 165 GCMClient::Result GCMDriverAndroid::EnsureStarted() { |
157 // TODO(johnme): Maybe we should check if GMS is available? | 166 // TODO(johnme): Maybe we should check if GMS is available? |
158 return GCMClient::SUCCESS; | 167 return GCMClient::SUCCESS; |
159 } | 168 } |
160 | 169 |
161 void GCMDriverAndroid::RegisterImpl( | 170 void GCMDriverAndroid::RegisterImpl( |
162 const std::string& app_id, | 171 const std::string& app_id, |
163 const std::vector<std::string>& sender_ids) { | 172 const std::vector<std::string>& sender_ids) { |
164 JNIEnv* env = AttachCurrentThread(); | 173 JNIEnv* env = AttachCurrentThread(); |
165 Java_GCMDriver_register( | 174 Java_GCMDriver_register( |
166 env, java_ref_.obj(), | 175 env, java_ref_.obj(), |
167 ConvertUTF8ToJavaString(env, app_id).Release(), | 176 ConvertUTF8ToJavaString(env, app_id).Release(), |
168 ToJavaArrayOfStrings(env, sender_ids).obj()); | 177 ToJavaArrayOfStrings(env, sender_ids).obj()); |
169 } | 178 } |
170 | 179 |
171 void GCMDriverAndroid::UnregisterImpl(const std::string& app_id) { | 180 void GCMDriverAndroid::UnregisterImpl(const std::string& app_id) { |
172 JNIEnv* env = AttachCurrentThread(); | 181 JNIEnv* env = AttachCurrentThread(); |
173 Java_GCMDriver_unregister( | 182 Java_GCMDriver_unregister( |
174 env, java_ref_.obj(), | 183 env, java_ref_.obj(), |
175 ConvertUTF8ToJavaString(env, app_id).Release()); | 184 ConvertUTF8ToJavaString(env, app_id).Release()); |
176 } | 185 } |
177 | 186 |
178 void GCMDriverAndroid::SendImpl(const std::string& app_id, | 187 void GCMDriverAndroid::SendImpl(const std::string& app_id, |
179 const std::string& receiver_id, | 188 const std::string& receiver_id, |
180 const GCMClient::OutgoingMessage& message) { | 189 const GCMClient::OutgoingMessage& message) { |
181 NOTIMPLEMENTED(); | 190 NOTIMPLEMENTED(); |
182 } | 191 } |
183 | 192 |
184 } // namespace gcm | 193 } // namespace gcm |
OLD | NEW |