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

Unified Diff: chrome/browser/android/offline_pages/offline_page_bridge.cc

Issue 1232843003: [Offline Pages] Stub of offline pages bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving offline_page_bridge.cc/h to c/b/a/offline_pages Created 5 years, 5 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/offline_pages/offline_page_bridge.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_bridge.cc b/chrome/browser/android/offline_pages/offline_page_bridge.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c2f9d426058ca97e73ed27b99ec7dcd46258e7f5
--- /dev/null
+++ b/chrome/browser/android/offline_pages/offline_page_bridge.cc
@@ -0,0 +1,37 @@
+// 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/offline_pages/offline_page_bridge.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_android.h"
+#include "components/offline_pages/offline_page_model.h"
+#include "jni/OfflinePageBridge_jni.h"
+
+namespace offline_pages {
+namespace android {
+
+OfflinePageBridge::OfflinePageBridge(JNIEnv* env, jobject obj, Profile* profile)
+ : weak_java_ref_(env, obj),
+ offline_page_model_(nullptr),
+ profile_(profile) {
+ // TODO(fgorski): Pull offline pages model from the factory once it is
+ // available.
+}
+
+void OfflinePageBridge::Destroy(JNIEnv*, jobject) {
+ delete this;
+}
+
+static jlong Init(JNIEnv* env, jobject obj, jobject j_profile) {
+ return reinterpret_cast<jlong>(new OfflinePageBridge(
+ env, obj, ProfileAndroid::FromProfileAndroid(j_profile)));
+}
+
+bool RegisterOfflinePageBridge(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
+
+} // namespace android
+} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698