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

Side by Side Diff: content/browser/android/web_contents_observer_android.cc

Issue 877163005: [Android] Fix new tab not to show 'about:blank' at the beginning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reformatted header Created 5 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/android/web_contents_observer_android.h" 5 #include "content/browser/android/web_contents_observer_android.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include <jni.h> 9 #include <jni.h>
10 10
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 void WebContentsObserverAndroid::DidFirstVisuallyNonEmptyPaint() { 329 void WebContentsObserverAndroid::DidFirstVisuallyNonEmptyPaint() {
330 JNIEnv* env = AttachCurrentThread(); 330 JNIEnv* env = AttachCurrentThread();
331 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); 331 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env));
332 if (obj.is_null()) 332 if (obj.is_null())
333 return; 333 return;
334 Java_WebContentsObserver_didFirstVisuallyNonEmptyPaint( 334 Java_WebContentsObserver_didFirstVisuallyNonEmptyPaint(
335 env, obj.obj()); 335 env, obj.obj());
336 } 336 }
337 337
338 void WebContentsObserverAndroid::DidStartNavigationToPendingEntry(
339 const GURL& url,
340 NavigationController::ReloadType reload_type) {
341 JNIEnv* env = AttachCurrentThread();
342 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env));
343 if (obj.is_null())
344 return;
345 ScopedJavaLocalRef<jstring> jstring_url(
346 ConvertUTF8ToJavaString(env, url.spec()));
347
348 Java_WebContentsObserver_didStartNavigationToPendingEntry(env, obj.obj(),
349 jstring_url.obj());
350 }
351
338 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { 352 bool RegisterWebContentsObserverAndroid(JNIEnv* env) {
339 return RegisterNativesImpl(env); 353 return RegisterNativesImpl(env);
340 } 354 }
341 } // namespace content 355 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698