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

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: Addressing feedback 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
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_bridge.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b40611e0c58ed7298154dd2b08cf74fcabe84924
--- /dev/null
+++ b/chrome/browser/android/offline_pages/offline_page_bridge.cc
@@ -0,0 +1,40 @@
+// 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 "content/public/browser/browser_context.h"
+#include "jni/OfflinePageBridge_jni.h"
+
+namespace offline_pages {
+namespace android {
+
+OfflinePageBridge::OfflinePageBridge(JNIEnv* env,
+ jobject obj,
+ content::BrowserContext* browser_context)
+ : weak_java_ref_(env, obj),
+ offline_page_model_(nullptr),
+ browser_context_(browser_context) {
+ // 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
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_bridge.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698