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

Unified Diff: chrome/browser/android/ntp_snippets_launcher.cc

Issue 1811333003: Move the remaining NTP realted files to c/b/android/ntp subdir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/ntp_snippets_launcher.cc
diff --git a/chrome/browser/android/ntp_snippets_launcher.cc b/chrome/browser/android/ntp_snippets_launcher.cc
deleted file mode 100644
index 3b054657a56e84d30fd30c9ff48e5635acbd79b4..0000000000000000000000000000000000000000
--- a/chrome/browser/android/ntp_snippets_launcher.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 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/ntp_snippets_launcher.h"
-
-#include "base/android/context_utils.h"
-#include "content/public/browser/browser_thread.h"
-#include "jni/SnippetsLauncher_jni.h"
-
-using content::BrowserThread;
-
-namespace {
-
-base::LazyInstance<NTPSnippetsLauncher> g_snippets_launcher =
- LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
-// static
-NTPSnippetsLauncher* NTPSnippetsLauncher::Get() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- return g_snippets_launcher.Pointer();
-}
-
-// static
-bool NTPSnippetsLauncher::Register(JNIEnv* env) {
- return RegisterNativesImpl(env);
-}
-
-bool NTPSnippetsLauncher::Schedule(int period_seconds) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- JNIEnv* env = base::android::AttachCurrentThread();
- return Java_SnippetsLauncher_schedule(
- env, java_launcher_.obj(), period_seconds);
-}
-
-bool NTPSnippetsLauncher::Unschedule() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- JNIEnv* env = base::android::AttachCurrentThread();
- return Java_SnippetsLauncher_unschedule(env, java_launcher_.obj());
-}
-
-NTPSnippetsLauncher::NTPSnippetsLauncher() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- JNIEnv* env = base::android::AttachCurrentThread();
- java_launcher_.Reset(Java_SnippetsLauncher_create(
- env, base::android::GetApplicationContext()));
-}
-
-NTPSnippetsLauncher::~NTPSnippetsLauncher() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_SnippetsLauncher_destroy(env, java_launcher_.obj());
- java_launcher_.Reset();
-}

Powered by Google App Engine
This is Rietveld 408576698