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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java

Issue 2366023002: Add WebViewDatabaseAdapter#{get,set}HttpAuthUsernamePassword (Closed)
Patch Set: No-op for targeting O+ Created 4 years, 2 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
« no previous file with comments | « no previous file | android_webview/glue/java/src/com/android/webview/chromium/WebViewDatabaseAdapter.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package com.android.webview.chromium; 5 package com.android.webview.chromium;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 357 }
358 358
359 @Override 359 @Override
360 public void savePassword(String host, String username, String password) { 360 public void savePassword(String host, String username, String password) {
361 // This is a deprecated API: intentional no-op. 361 // This is a deprecated API: intentional no-op.
362 } 362 }
363 363
364 @Override 364 @Override
365 public void setHttpAuthUsernamePassword( 365 public void setHttpAuthUsernamePassword(
366 final String host, final String realm, final String username, final String password) { 366 final String host, final String realm, final String username, final String password) {
367 if (mAppTargetSdkVersion > Build.VERSION_CODES.N) return;
Nate Fischer 2016/09/26 20:29:37 I've implemented the no-op for O+ here. Please tel
367 if (checkNeedsPost()) { 368 if (checkNeedsPost()) {
368 mFactory.addTask(new Runnable() { 369 mFactory.addTask(new Runnable() {
369 @Override 370 @Override
370 public void run() { 371 public void run() {
371 setHttpAuthUsernamePassword(host, realm, username, password) ; 372 setHttpAuthUsernamePassword(host, realm, username, password) ;
372 } 373 }
373 }); 374 });
374 return; 375 return;
375 } 376 }
376 mAwContents.setHttpAuthUsernamePassword(host, realm, username, password) ; 377 ((WebViewDatabaseAdapter) mFactory.getWebViewDatabase(mContext))
378 .setHttpAuthUsernamePassword(host, realm, username, password);
377 } 379 }
378 380
379 @Override 381 @Override
380 public String[] getHttpAuthUsernamePassword(final String host, final String realm) { 382 public String[] getHttpAuthUsernamePassword(final String host, final String realm) {
381 mFactory.startYourEngines(true); 383 mFactory.startYourEngines(true);
384 if (mAppTargetSdkVersion > Build.VERSION_CODES.N) return null;
Nate Fischer 2016/09/26 20:29:37 Let me know if the no-op should return a non-null
382 if (checkNeedsPost()) { 385 if (checkNeedsPost()) {
383 String[] ret = mFactory.runOnUiThreadBlocking(new Callable<String[]> () { 386 String[] ret = mFactory.runOnUiThreadBlocking(new Callable<String[]> () {
384 @Override 387 @Override
385 public String[] call() { 388 public String[] call() {
386 return getHttpAuthUsernamePassword(host, realm); 389 return getHttpAuthUsernamePassword(host, realm);
387 } 390 }
388 }); 391 });
389 return ret; 392 return ret;
390 } 393 }
391 return mAwContents.getHttpAuthUsernamePassword(host, realm); 394 return ((WebViewDatabaseAdapter) mFactory.getWebViewDatabase(mContext))
395 .getHttpAuthUsernamePassword(host, realm);
392 } 396 }
393 397
394 @Override 398 @Override
395 public void destroy() { 399 public void destroy() {
396 if (checkNeedsPost()) { 400 if (checkNeedsPost()) {
397 mFactory.addTask(new Runnable() { 401 mFactory.addTask(new Runnable() {
398 @Override 402 @Override
399 public void run() { 403 public void run() {
400 destroy(); 404 destroy();
401 } 405 }
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 mAwContents.extractSmartClipData(x, y, width, height); 2266 mAwContents.extractSmartClipData(x, y, width, height);
2263 } 2267 }
2264 2268
2265 // Implements SmartClipProvider 2269 // Implements SmartClipProvider
2266 @Override 2270 @Override
2267 public void setSmartClipResultHandler(final Handler resultHandler) { 2271 public void setSmartClipResultHandler(final Handler resultHandler) {
2268 checkThread(); 2272 checkThread();
2269 mAwContents.setSmartClipResultHandler(resultHandler); 2273 mAwContents.setSmartClipResultHandler(resultHandler);
2270 } 2274 }
2271 } 2275 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/glue/java/src/com/android/webview/chromium/WebViewDatabaseAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698