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

Side by Side Diff: android_webview/native/aw_web_contents_delegate.cc

Issue 11640007: Make the UI an observer of downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android clang build Created 7 years, 9 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 "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/find_helper.h" 7 #include "android_webview/browser/find_helper.h"
8 #include "android_webview/native/aw_contents.h" 8 #include "android_webview/native/aw_contents.h"
9 #include "android_webview/native/aw_javascript_dialog_manager.h" 9 #include "android_webview/native/aw_javascript_dialog_manager.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source, 55 bool AwWebContentsDelegate::CanDownload(content::RenderViewHost* source,
56 int request_id, 56 int request_id,
57 const std::string& request_method) { 57 const std::string& request_method) {
58 // Android webview intercepts download in its resource dispatcher host 58 // Android webview intercepts download in its resource dispatcher host
59 // delegate, so should not reach here. 59 // delegate, so should not reach here.
60 NOTREACHED(); 60 NOTREACHED();
61 return false; 61 return false;
62 } 62 }
63 63
64 void AwWebContentsDelegate::OnStartDownload(WebContents* source,
65 content::DownloadItem* download) {
66 NOTREACHED(); // Downloads are cancelled in ResourceDispatcherHostDelegate.
67 }
68
69 void AwWebContentsDelegate::AddNewContents(content::WebContents* source, 64 void AwWebContentsDelegate::AddNewContents(content::WebContents* source,
70 content::WebContents* new_contents, 65 content::WebContents* new_contents,
71 WindowOpenDisposition disposition, 66 WindowOpenDisposition disposition,
72 const gfx::Rect& initial_pos, 67 const gfx::Rect& initial_pos,
73 bool user_gesture, 68 bool user_gesture,
74 bool* was_blocked) { 69 bool* was_blocked) {
75 JNIEnv* env = AttachCurrentThread(); 70 JNIEnv* env = AttachCurrentThread();
76 71
77 bool is_dialog = disposition == NEW_POPUP; 72 bool is_dialog = disposition == NEW_POPUP;
78 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env); 73 ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (java_delegate.obj()) { 118 if (java_delegate.obj()) {
124 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj()); 119 Java_AwWebContentsDelegate_activateContents(env, java_delegate.obj());
125 } 120 }
126 } 121 }
127 122
128 bool RegisterAwWebContentsDelegate(JNIEnv* env) { 123 bool RegisterAwWebContentsDelegate(JNIEnv* env) {
129 return RegisterNativesImpl(env); 124 return RegisterNativesImpl(env);
130 } 125 }
131 126
132 } // namespace android_webview 127 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_web_contents_delegate.h ('k') | chrome/browser/android/chrome_web_contents_delegate_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698