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 | |
178 // Notifies the delegate about the creation of a new WebContents. This | 166 // Notifies the delegate about the creation of a new WebContents. This |
179 // typically happens when popups are created. | 167 // typically happens when popups are created. |
180 void AwWebContentsDelegate::WebContentsCreated( | 168 void AwWebContentsDelegate::WebContentsCreated( |
181 WebContents* source_contents, | 169 WebContents* source_contents, |
182 int opener_render_frame_id, | 170 int opener_render_frame_id, |
183 const base::string16& frame_name, | 171 const base::string16& frame_name, |
184 const GURL& target_url, | 172 const GURL& target_url, |
185 content::WebContents* new_contents) { | 173 content::WebContents* new_contents) { |
186 AwContentsIoThreadClientImpl::RegisterPendingContents(new_contents); | 174 AwContentsIoThreadClientImpl::RegisterPendingContents(new_contents); |
187 } | 175 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 DVLOG(0) << "File Chooser result: mode = " << mode | 268 DVLOG(0) << "File Chooser result: mode = " << mode |
281 << ", file paths = " << JoinString(file_path_str, ":"); | 269 << ", file paths = " << JoinString(file_path_str, ":"); |
282 rvh->FilesSelectedInChooser(files, mode); | 270 rvh->FilesSelectedInChooser(files, mode); |
283 } | 271 } |
284 | 272 |
285 bool RegisterAwWebContentsDelegate(JNIEnv* env) { | 273 bool RegisterAwWebContentsDelegate(JNIEnv* env) { |
286 return RegisterNativesImpl(env); | 274 return RegisterNativesImpl(env); |
287 } | 275 } |
288 | 276 |
289 } // namespace android_webview | 277 } // namespace android_webview |
OLD | NEW |