| 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);
|
| +}
|
|
|