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

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

Issue 11187032: Handle resubmission of HTTP Posts. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: addressed code review Created 8 years, 1 month 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 "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"
11 #include "content/public/browser/android/content_view_core.h"
11 #include "content/public/browser/render_widget_host_view.h" 12 #include "content/public/browser/render_widget_host_view.h"
12 #include "content/public/browser/invalidate_type.h" 13 #include "content/public/browser/invalidate_type.h"
13 #include "content/public/browser/page_navigator.h" 14 #include "content/public/browser/page_navigator.h"
14 #include "content/public/browser/navigation_controller.h" 15 #include "content/public/browser/navigation_controller.h"
15 #include "content/public/browser/navigation_entry.h" 16 #include "content/public/browser/navigation_entry.h"
16 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
17 #include "content/public/common/page_transition_types.h" 18 #include "content/public/common/page_transition_types.h"
18 #include "content/public/common/referrer.h" 19 #include "content/public/common/referrer.h"
19 #include "jni/WebContentsDelegateAndroid_jni.h" 20 #include "jni/WebContentsDelegateAndroid_jni.h"
20 #include "ui/gfx/rect.h" 21 #include "ui/gfx/rect.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 259
259 bool WebContentsDelegateAndroid::TakeFocus(WebContents* source, bool reverse) { 260 bool WebContentsDelegateAndroid::TakeFocus(WebContents* source, bool reverse) {
260 JNIEnv* env = AttachCurrentThread(); 261 JNIEnv* env = AttachCurrentThread();
261 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 262 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
262 if (obj.is_null()) 263 if (obj.is_null())
263 return WebContentsDelegate::TakeFocus(source, reverse); 264 return WebContentsDelegate::TakeFocus(source, reverse);
264 return Java_WebContentsDelegateAndroid_takeFocus( 265 return Java_WebContentsDelegateAndroid_takeFocus(
265 env, obj.obj(), reverse); 266 env, obj.obj(), reverse);
266 } 267 }
267 268
269 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog(
270 WebContents* source) {
271 JNIEnv* env = AttachCurrentThread();
272 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
273 if (obj.is_null())
274 return;
275 ScopedJavaLocalRef<jobject> contentViewCore =
joth 2012/10/23 00:05:31 nit: hacker style: content_view_core
sgurun-gerrit only 2012/10/23 00:28:11 Done.
276 content::ContentViewCore::FromWebContents(source)->GetJavaObject();
277 if (contentViewCore.is_null())
278 return;
279 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj(),
280 contentViewCore.obj());
281 }
282
268 // ---------------------------------------------------------------------------- 283 // ----------------------------------------------------------------------------
269 // Native JNI methods 284 // Native JNI methods
270 // ---------------------------------------------------------------------------- 285 // ----------------------------------------------------------------------------
271 286
272 // Register native methods 287 // Register native methods
273 288
274 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { 289 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) {
275 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { 290 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) {
276 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; 291 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!";
277 return false; 292 return false;
278 } 293 }
279 return RegisterNativesImpl(env); 294 return RegisterNativesImpl(env);
280 } 295 }
281 296
282 } // namespace web_contents_delegate_android 297 } // namespace web_contents_delegate_android
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698