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

Side by Side Diff: blimp/client/core/android/blimp_contents_observer_proxy.cc

Issue 2058263002: Tied up BlimpNavigationController to NavigationFeature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blimp_core
Patch Set: Changed BlimpContentsObserver's navigation methods to OnNavigationStateChanged Created 4 years, 4 months 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 #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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698