| OLD | NEW |
| 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 #include "blimp/client/core/android/blimp_contents_observer_proxy.h" | 5 #include "blimp/client/core/android/blimp_contents_observer_proxy.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "blimp/client/core/android/blimp_contents_impl_android.h" | 10 #include "blimp/client/core/android/blimp_contents_impl_android.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 BlimpContentsObserverProxy::~BlimpContentsObserverProxy() {} | 41 BlimpContentsObserverProxy::~BlimpContentsObserverProxy() {} |
| 42 | 42 |
| 43 void BlimpContentsObserverProxy::Destroy( | 43 void BlimpContentsObserverProxy::Destroy( |
| 44 JNIEnv* env, | 44 JNIEnv* env, |
| 45 const base::android::JavaParamRef<jobject>& jobj) { | 45 const base::android::JavaParamRef<jobject>& jobj) { |
| 46 blimp_contents_impl_android_->blimp_contents_impl()->RemoveObserver(this); | 46 blimp_contents_impl_android_->blimp_contents_impl()->RemoveObserver(this); |
| 47 delete this; | 47 delete this; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void BlimpContentsObserverProxy::OnURLUpdated(const GURL& url) { | 50 void BlimpContentsObserverProxy::OnNavigationStateChanged() { |
| 51 JNIEnv* env = base::android::AttachCurrentThread(); | 51 JNIEnv* env = base::android::AttachCurrentThread(); |
| 52 base::android::ScopedJavaLocalRef<jobject> obj(java_obj_); | 52 Java_BlimpContentsObserverProxy_onNavigationStateChanged(env, |
| 53 base::android::ScopedJavaLocalRef<jstring> jstring_url( | 53 java_obj_.obj()); |
| 54 base::android::ConvertUTF8ToJavaString(env, url.spec())); | |
| 55 | |
| 56 Java_BlimpContentsObserverProxy_onUrlUpdated(env, obj.obj(), | |
| 57 jstring_url.obj()); | |
| 58 } | 54 } |
| 59 | 55 |
| 60 } // namespace client | 56 } // namespace client |
| 61 } // namespace blimp | 57 } // namespace blimp |
| OLD | NEW |