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

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

Issue 2262453002: Cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix stuff. Created 4 years, 4 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/java/src/org/chromium/android_webview/AwBrowserProcess.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.Manifest; 7 import android.Manifest;
8 import android.app.ActivityManager; 8 import android.app.ActivityManager;
9 import android.content.ComponentCallbacks2; 9 import android.content.ComponentCallbacks2;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 System.loadLibrary("webviewchromium_plat_support"); 214 System.loadLibrary("webviewchromium_plat_support");
215 215
216 // Use shared preference to check for package downgrade. 216 // Use shared preference to check for package downgrade.
217 mWebViewPrefs = ContextUtils.getApplicationContext().getSharedPreference s( 217 mWebViewPrefs = ContextUtils.getApplicationContext().getSharedPreference s(
218 CHROMIUM_PREFS_NAME, Context.MODE_PRIVATE); 218 CHROMIUM_PREFS_NAME, Context.MODE_PRIVATE);
219 int lastVersion = mWebViewPrefs.getInt(VERSION_CODE_PREF, 0); 219 int lastVersion = mWebViewPrefs.getInt(VERSION_CODE_PREF, 0);
220 int currentVersion = packageInfo.versionCode; 220 int currentVersion = packageInfo.versionCode;
221 if (!versionCodeGE(currentVersion, lastVersion)) { 221 if (!versionCodeGE(currentVersion, lastVersion)) {
222 // The WebView package has been downgraded since we last ran in this application. 222 // The WebView package has been downgraded since we last ran in this application.
223 // Delete the WebView data directory's contents. 223 // Delete the WebView data directory's contents.
224 String dataDir = PathUtils.getDataDirectory(ContextUtils.getApplicat ionContext()); 224 String dataDir = PathUtils.getDataDirectory();
225 Log.i(TAG, "WebView package downgraded from " + lastVersion + " to " + currentVersion 225 Log.i(TAG, "WebView package downgraded from " + lastVersion + " to " + currentVersion
226 + "; deleting contents of " + dataDir); 226 + "; deleting contents of " + dataDir);
227 deleteContents(new File(dataDir)); 227 deleteContents(new File(dataDir));
228 } 228 }
229 if (lastVersion != currentVersion) { 229 if (lastVersion != currentVersion) {
230 mWebViewPrefs.edit().putInt(VERSION_CODE_PREF, currentVersion).apply (); 230 mWebViewPrefs.edit().putInt(VERSION_CODE_PREF, currentVersion).apply ();
231 } 231 }
232 // Now safe to use WebView data directory. 232 // Now safe to use WebView data directory.
233 } 233 }
234 234
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase); 561 mWebViewDatabase = new WebViewDatabaseAdapter(this, awDatabase);
562 } 562 }
563 } 563 }
564 return mWebViewDatabase; 564 return mWebViewDatabase;
565 } 565 }
566 566
567 WebViewDelegate getWebViewDelegate() { 567 WebViewDelegate getWebViewDelegate() {
568 return mWebViewDelegate; 568 return mWebViewDelegate;
569 } 569 }
570 } 570 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698