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 "android_webview/native/aw_web_contents_delegate.h" | 5 #include "android_webview/native/aw_web_contents_delegate.h" |
6 | 6 |
7 #include "android_webview/browser/aw_javascript_dialog_manager.h" | 7 #include "android_webview/browser/aw_javascript_dialog_manager.h" |
8 #include "android_webview/browser/find_helper.h" | 8 #include "android_webview/browser/find_helper.h" |
9 #include "android_webview/native/aw_contents.h" | 9 #include "android_webview/native/aw_contents.h" |
10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" | 10 #include "android_webview/native/aw_contents_io_thread_client_impl.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // DeleteSoon as WebContentsImpl may call methods on |new_contents| | 156 // DeleteSoon as WebContentsImpl may call methods on |new_contents| |
157 // after this method returns. | 157 // after this method returns. |
158 base::MessageLoop::current()->DeleteSoon(FROM_HERE, new_contents); | 158 base::MessageLoop::current()->DeleteSoon(FROM_HERE, new_contents); |
159 } | 159 } |
160 | 160 |
161 if (was_blocked) { | 161 if (was_blocked) { |
162 *was_blocked = !create_popup; | 162 *was_blocked = !create_popup; |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
| 166 void AwWebContentsDelegate::NavigationStateChanged( |
| 167 content::WebContents* source, |
| 168 content::InvalidateTypes changed_flags) { |
| 169 JNIEnv* env = AttachCurrentThread(); |
| 170 |
| 171 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); |
| 172 if (java_delegate.obj()) { |
| 173 Java_AwWebContentsDelegate_navigationStateChanged(env, java_delegate.obj(), |
| 174 changed_flags); |
| 175 } |
| 176 } |
| 177 |
166 // Notifies the delegate about the creation of a new WebContents. This | 178 // Notifies the delegate about the creation of a new WebContents. This |
167 // typically happens when popups are created. | 179 // typically happens when popups are created. |
168 void AwWebContentsDelegate::WebContentsCreated( | 180 void AwWebContentsDelegate::WebContentsCreated( |
169 WebContents* source_contents, | 181 WebContents* source_contents, |
170 int opener_render_frame_id, | 182 int opener_render_frame_id, |
171 const base::string16& frame_name, | 183 const base::string16& frame_name, |
172 const GURL& target_url, | 184 const GURL& target_url, |
173 content::WebContents* new_contents) { | 185 content::WebContents* new_contents) { |
174 AwContentsIoThreadClientImpl::RegisterPendingContents(new_contents); | 186 AwContentsIoThreadClientImpl::RegisterPendingContents(new_contents); |
175 } | 187 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 DVLOG(0) << "File Chooser result: mode = " << mode | 280 DVLOG(0) << "File Chooser result: mode = " << mode |
269 << ", file paths = " << JoinString(file_path_str, ":"); | 281 << ", file paths = " << JoinString(file_path_str, ":"); |
270 rvh->FilesSelectedInChooser(files, mode); | 282 rvh->FilesSelectedInChooser(files, mode); |
271 } | 283 } |
272 | 284 |
273 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 285 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
274 return RegisterNativesImpl(env); | 286 return RegisterNativesImpl(env); |
275 } | 287 } |
276 | 288 |
277 } // namespace android_webview | 289 } // namespace android_webview |
OLD | NEW |