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

Unified Diff: chrome/browser/offline_pages/android/load_termination_listener_impl.h

Issue 2898393002: Split Android-specific dependency from BackgroundLoaderOffliner. Create a subfolder of c/b/offline_… (Closed)
Patch Set: more build fixes Created 3 years, 7 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/offline_pages/android/load_termination_listener_impl.h
diff --git a/chrome/browser/offline_pages/android/load_termination_listener_impl.h b/chrome/browser/offline_pages/android/load_termination_listener_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..47168f729e6e77ffdfb094737a30d77a725fdf6e
--- /dev/null
+++ b/chrome/browser/offline_pages/android/load_termination_listener_impl.h
@@ -0,0 +1,33 @@
+// Copyright 2017 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_OFFLINE_PAGES_ANDROID_LOAD_TERMINATION_LISTENER_IMPL_H_
+#define CHROME_BROWSER_OFFLINE_PAGES_ANDROID_LOAD_TERMINATION_LISTENER_IMPL_H_
+
+#include "base/android/application_status_listener.h"
+#include "components/offline_pages/core/background/load_termination_listener.h"
+
+namespace offline_pages {
+
+// Implementation of LoadTerminationListener for Android.
+class LoadTerminationListenerImpl : public LoadTerminationListener {
+ public:
+ LoadTerminationListenerImpl();
+ ~LoadTerminationListenerImpl() override;
+
+ // Callback
+ void OnApplicationStateChange(
+ base::android::ApplicationState application_state);
+
+ private:
+ // An instance of Android AppListener.
+ std::unique_ptr<base::android::ApplicationStatusListener> app_listener_;
+
+ base::WeakPtrFactory<LoadTerminationListenerImpl> weak_ptr_factory_;
+ DISALLOW_COPY_AND_ASSIGN(LoadTerminationListenerImpl);
+};
+
+} // namespace offline_pages
+
+#endif // CHROME_BROWSER_OFFLINE_PAGES_ANDROID_LOAD_TERMINATION_LISTENER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698