| OLD | NEW |
| 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/android/chrome_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/chrome_web_contents_delegate_android.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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 ChromeWebContentsDelegateAndroid::~ChromeWebContentsDelegateAndroid() { | 81 ChromeWebContentsDelegateAndroid::~ChromeWebContentsDelegateAndroid() { |
| 82 notification_registrar_.RemoveAll(); | 82 notification_registrar_.RemoveAll(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Register native methods. | 85 // Register native methods. |
| 86 bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env) { | 86 bool RegisterChromeWebContentsDelegateAndroid(JNIEnv* env) { |
| 87 return RegisterNativesImpl(env); | 87 return RegisterNativesImpl(env); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ChromeWebContentsDelegateAndroid::LoadingStateChanged( | 90 void ChromeWebContentsDelegateAndroid::LoadingStateChanged( |
| 91 WebContents* source) { | 91 WebContents* source, bool to_different_document) { |
| 92 bool has_stopped = source == NULL || !source->IsLoading(); | 92 bool has_stopped = source == NULL || !source->IsLoading(); |
| 93 WebContentsDelegateAndroid::LoadingStateChanged(source); | 93 WebContentsDelegateAndroid::LoadingStateChanged( |
| 94 source, to_different_document); |
| 94 LoadProgressChanged(source, has_stopped ? 1 : 0); | 95 LoadProgressChanged(source, has_stopped ? 1 : 0); |
| 95 } | 96 } |
| 96 | 97 |
| 97 void ChromeWebContentsDelegateAndroid::RunFileChooser( | 98 void ChromeWebContentsDelegateAndroid::RunFileChooser( |
| 98 WebContents* web_contents, | 99 WebContents* web_contents, |
| 99 const FileChooserParams& params) { | 100 const FileChooserParams& params) { |
| 100 FileSelectHelper::RunFileChooser(web_contents, params); | 101 FileSelectHelper::RunFileChooser(web_contents, params); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void ChromeWebContentsDelegateAndroid::CloseContents( | 104 void ChromeWebContentsDelegateAndroid::CloseContents( |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 return; | 337 return; |
| 337 Java_ChromeWebContentsDelegateAndroid_webContentsCreated(env, obj.obj(), | 338 Java_ChromeWebContentsDelegateAndroid_webContentsCreated(env, obj.obj(), |
| 338 reinterpret_cast<intptr_t>(source_contents), opener_render_frame_id, | 339 reinterpret_cast<intptr_t>(source_contents), opener_render_frame_id, |
| 339 base::android::ConvertUTF16ToJavaString(env, frame_name).Release(), | 340 base::android::ConvertUTF16ToJavaString(env, frame_name).Release(), |
| 340 base::android::ConvertUTF8ToJavaString(env, target_url.spec()).Release(), | 341 base::android::ConvertUTF8ToJavaString(env, target_url.spec()).Release(), |
| 341 reinterpret_cast<intptr_t>(new_contents)); | 342 reinterpret_cast<intptr_t>(new_contents)); |
| 342 } | 343 } |
| 343 | 344 |
| 344 } // namespace android | 345 } // namespace android |
| 345 } // namespace chrome | 346 } // namespace chrome |
| OLD | NEW |