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

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

Issue 2103243002: Factor out ContentViewAndroidDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "android_webview/browser/aw_browser_context.h" 10 #include "android_webview/browser/aw_browser_context.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 void AwContents::InitAutofillIfNecessary(bool enabled) { 259 void AwContents::InitAutofillIfNecessary(bool enabled) {
260 // Do not initialize if the feature is not enabled. 260 // Do not initialize if the feature is not enabled.
261 if (!enabled) 261 if (!enabled)
262 return; 262 return;
263 // Check if the autofill driver factory already exists. 263 // Check if the autofill driver factory already exists.
264 content::WebContents* web_contents = web_contents_.get(); 264 content::WebContents* web_contents = web_contents_.get();
265 if (ContentAutofillDriverFactory::FromWebContents(web_contents)) 265 if (ContentAutofillDriverFactory::FromWebContents(web_contents))
266 return; 266 return;
267 267
268 AwAutofillClient::CreateForWebContents(web_contents); 268 AwAutofillClient::CreateForWebContents(web_contents);
269 ContentViewCore* cvc =
270 ContentViewCore::FromWebContents(web_contents_.get());
271 DCHECK(cvc);
272 AwAutofillClient* autofill_client =
273 AwAutofillClient::FromWebContents(web_contents);
274 autofill_client->SetViewAndroid(cvc->GetViewAndroid());
269 ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( 275 ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
270 web_contents, AwAutofillClient::FromWebContents(web_contents), 276 web_contents, autofill_client,
271 base::android::GetDefaultLocale(), 277 base::android::GetDefaultLocale(),
272 AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER); 278 AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
273 } 279 }
274 280
275 void AwContents::SetAwAutofillClient(jobject client) { 281 void AwContents::SetAwAutofillClient(jobject client) {
276 DCHECK_CURRENTLY_ON(BrowserThread::UI); 282 DCHECK_CURRENTLY_ON(BrowserThread::UI);
277 JNIEnv* env = AttachCurrentThread(); 283 JNIEnv* env = AttachCurrentThread();
278 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 284 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
279 if (obj.is_null()) 285 if (obj.is_null())
280 return; 286 return;
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 int routing_id = new_host->GetRoutingID(); 1310 int routing_id = new_host->GetRoutingID();
1305 // At this point, the current RVH may or may not contain a compositor. So 1311 // At this point, the current RVH may or may not contain a compositor. So
1306 // compositor_ may be nullptr, in which case 1312 // compositor_ may be nullptr, in which case
1307 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the 1313 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the
1308 // new compositor is constructed. 1314 // new compositor is constructed.
1309 browser_view_renderer_.SetActiveCompositorID( 1315 browser_view_renderer_.SetActiveCompositorID(
1310 CompositorID(process_id, routing_id)); 1316 CompositorID(process_id, routing_id));
1311 } 1317 }
1312 1318
1313 } // namespace android_webview 1319 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698