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

Unified Diff: chrome/browser/android/webapps/webapp_registry.cc

Issue 1329083002: Clear webapp storage when site data is cleared (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add initial tests and fix compile Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/webapps/webapp_registry.cc
diff --git a/chrome/browser/android/webapps/webapp_registry.cc b/chrome/browser/android/webapps/webapp_registry.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3829e073ad4143cb6a806017b3b29b180c82cb39
--- /dev/null
+++ b/chrome/browser/android/webapps/webapp_registry.cc
@@ -0,0 +1,34 @@
+// Copyright 2015 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.
+
+#include "chrome/browser/android/webapps/webapp_registry.h"
+
+#include <jni.h>
+
+#include "base/android/jni_android.h"
+#include "base/callback.h"
+#include "chrome/browser/io_thread.h"
+#include "content/public/browser/browser_thread.h"
+#include "jni/WebappRegistry_jni.h"
+
+// static
+void WebappRegistry::UnregisterWebappsOnIOThread(
+ const base::Closure& callback) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_WebappRegistry_unregisterAllWebappsInBackground(
+ env,
+ base::android::GetApplicationContext());
+
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI,
+ FROM_HERE,
+ callback);
+}
+
+// static
+bool WebappRegistry::RegisterWebappRegistry(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}

Powered by Google App Engine
This is Rietveld 408576698