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

Side by Side Diff: chrome/browser/component/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 10868116: Pass result of blockage across content API when new tab blocked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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 "chrome/browser/component/web_contents_delegate_android/web_contents_de legate_android.h" 5 #include "chrome/browser/component/web_contents_delegate_android/web_contents_de legate_android.h"
6 6
7 #include <android/keycodes.h> 7 #include <android/keycodes.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 Java_WebContentsDelegateAndroid_onTabHeaderStateChanged( 131 Java_WebContentsDelegateAndroid_onTabHeaderStateChanged(
132 env, obj.obj()); 132 env, obj.obj());
133 } 133 }
134 } 134 }
135 135
136 void WebContentsDelegateAndroid::AddNewContents( 136 void WebContentsDelegateAndroid::AddNewContents(
137 WebContents* source, 137 WebContents* source,
138 WebContents* new_contents, 138 WebContents* new_contents,
139 WindowOpenDisposition disposition, 139 WindowOpenDisposition disposition,
140 const gfx::Rect& initial_pos, 140 const gfx::Rect& initial_pos,
141 bool user_gesture) { 141 bool user_gesture,
142 bool* was_blocked) {
142 JNIEnv* env = AttachCurrentThread(); 143 JNIEnv* env = AttachCurrentThread();
143 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 144 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
144 bool handled = false; 145 bool handled = false;
145 if (!obj.is_null()) { 146 if (!obj.is_null()) {
146 handled = Java_WebContentsDelegateAndroid_addNewContents( 147 handled = Java_WebContentsDelegateAndroid_addNewContents(
147 env, 148 env,
148 obj.obj(), 149 obj.obj(),
149 reinterpret_cast<jint>(source), 150 reinterpret_cast<jint>(source),
150 reinterpret_cast<jint>(new_contents), 151 reinterpret_cast<jint>(new_contents),
151 static_cast<jint>(disposition), 152 static_cast<jint>(disposition),
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 349
349 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { 350 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) {
350 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { 351 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) {
351 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; 352 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!";
352 return false; 353 return false;
353 } 354 }
354 return RegisterNativesImpl(env); 355 return RegisterNativesImpl(env);
355 } 356 }
356 357
357 } // namespace web_contents_delegate_android 358 } // namespace web_contents_delegate_android
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698