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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgent.java

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 org.chromium.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.backup.BackupAgent; 7 import android.app.backup.BackupAgent;
8 import android.app.backup.BackupDataInput; 8 import android.app.backup.BackupDataInput;
9 import android.app.backup.BackupDataOutput; 9 import android.app.backup.BackupDataOutput;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 public void save(ParcelFileDescriptor parceledState) throws IOException { 131 public void save(ParcelFileDescriptor parceledState) throws IOException {
132 FileOutputStream outstream = new FileOutputStream(parceledState.getF ileDescriptor()); 132 FileOutputStream outstream = new FileOutputStream(parceledState.getF ileDescriptor());
133 ObjectOutputStream out = new ObjectOutputStream(outstream); 133 ObjectOutputStream out = new ObjectOutputStream(outstream);
134 out.writeObject(mNames); 134 out.writeObject(mNames);
135 out.writeObject(mValues); 135 out.writeObject(mValues);
136 } 136 }
137 } 137 }
138 138
139 @VisibleForTesting 139 @VisibleForTesting
140 protected boolean accountExistsOnDevice(String userName) { 140 protected boolean accountExistsOnDevice(String userName) {
141 return AccountManagerHelper.get(this).getAccountFromName(userName) != nu ll; 141 return AccountManagerHelper.get().getAccountFromName(userName) != null;
142 } 142 }
143 143
144 @VisibleForTesting 144 @VisibleForTesting
145 protected boolean initializeBrowser(Context context) { 145 protected boolean initializeBrowser(Context context) {
146 try { 146 try {
147 ChromeBrowserInitializer.getInstance(context).handleSynchronousStart up(); 147 ChromeBrowserInitializer.getInstance(context).handleSynchronousStart up();
148 } catch (ProcessInitException e) { 148 } catch (ProcessInitException e) {
149 Log.w(TAG, "Browser launch failed on backup or restore: " + e); 149 Log.w(TAG, "Browser launch failed on backup or restore: " + e);
150 return false; 150 return false;
151 } 151 }
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 @VisibleForTesting 428 @VisibleForTesting
429 protected native String[] nativeGetBoolBackupNames(); 429 protected native String[] nativeGetBoolBackupNames();
430 430
431 @VisibleForTesting 431 @VisibleForTesting
432 protected native boolean[] nativeGetBoolBackupValues(); 432 protected native boolean[] nativeGetBoolBackupValues();
433 433
434 @VisibleForTesting 434 @VisibleForTesting
435 protected native void nativeSetBoolBackupPrefs(String[] name, boolean[] valu e); 435 protected native void nativeSetBoolBackupPrefs(String[] name, boolean[] valu e);
436 } 436 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698