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

Unified Diff: chrome/browser/android/chrome_backup_watcher.h

Issue 2511713002: Implement Android key/value backup (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/chrome_backup_watcher.h
diff --git a/chrome/browser/android/chrome_backup_watcher.h b/chrome/browser/android/chrome_backup_watcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..d8eab67721f47b7ba2e059fbd666e05a3e5e31ff
--- /dev/null
+++ b/chrome/browser/android/chrome_backup_watcher.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_CHROME_BACKUP_WATCHER_H_
+#define CHROME_BROWSER_ANDROID_CHROME_BACKUP_WATCHER_H_
+
+#include <jni.h>
+
+#include <memory>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "components/prefs/pref_change_registrar.h"
+
+class Profile;
+
+namespace chrome {
+namespace android {
+
+// Watch the preferences that we back up using Android Backup, so that we can
+// create a new backup whenever any of them change.
+class ChromeBackupWatcher {
+ public:
+ explicit ChromeBackupWatcher(Profile* profile);
+ virtual ~ChromeBackupWatcher();
+
+ private:
+ PrefChangeRegistrar registrar_;
+ base::android::ScopedJavaGlobalRef<jobject> java_watcher_;
+ DISALLOW_COPY_AND_ASSIGN(ChromeBackupWatcher);
+};
+
+} // namespace android
+} // namespace chrome
+#endif // CHROME_BROWSER_ANDROID_CHROME_BACKUP_WATCHER_H_
« no previous file with comments | « chrome/browser/android/chrome_backup_agent_unittest.cc ('k') | chrome/browser/android/chrome_backup_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698