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

Side by Side Diff: chrome/browser/android/ntp/ntp_snippets_launcher.cc

Issue 2794313002: [Remote suggestions] Prioritize wifi for soft fetches. (Closed)
Patch Set: Fix an error in rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/ntp/ntp_snippets_launcher.h" 5 #include "chrome/browser/android/ntp/ntp_snippets_launcher.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "jni/SnippetsLauncher_jni.h" 8 #include "jni/SnippetsLauncher_jni.h"
9 9
10 using content::BrowserThread; 10 using content::BrowserThread;
(...skipping 21 matching lines...) Expand all
32 period_fallback.InSeconds()); 32 period_fallback.InSeconds());
33 } 33 }
34 34
35 bool NTPSnippetsLauncher::Unschedule() { 35 bool NTPSnippetsLauncher::Unschedule() {
36 DCHECK_CURRENTLY_ON(BrowserThread::UI); 36 DCHECK_CURRENTLY_ON(BrowserThread::UI);
37 37
38 JNIEnv* env = base::android::AttachCurrentThread(); 38 JNIEnv* env = base::android::AttachCurrentThread();
39 return Java_SnippetsLauncher_unschedule(env, java_launcher_); 39 return Java_SnippetsLauncher_unschedule(env, java_launcher_);
40 } 40 }
41 41
42 bool NTPSnippetsLauncher::IsOnUnmeteredConnection() {
43 DCHECK_CURRENTLY_ON(BrowserThread::UI);
44
45 JNIEnv* env = base::android::AttachCurrentThread();
46 return Java_SnippetsLauncher_isOnUnmeteredConnection(env, java_launcher_);
47 }
48
42 NTPSnippetsLauncher::NTPSnippetsLauncher() { 49 NTPSnippetsLauncher::NTPSnippetsLauncher() {
43 DCHECK_CURRENTLY_ON(BrowserThread::UI); 50 DCHECK_CURRENTLY_ON(BrowserThread::UI);
44 51
45 JNIEnv* env = base::android::AttachCurrentThread(); 52 JNIEnv* env = base::android::AttachCurrentThread();
46 java_launcher_.Reset(Java_SnippetsLauncher_create(env)); 53 java_launcher_.Reset(Java_SnippetsLauncher_create(env));
47 } 54 }
48 55
49 NTPSnippetsLauncher::~NTPSnippetsLauncher() { 56 NTPSnippetsLauncher::~NTPSnippetsLauncher() {
50 DCHECK_CURRENTLY_ON(BrowserThread::UI); 57 DCHECK_CURRENTLY_ON(BrowserThread::UI);
51 58
52 JNIEnv* env = base::android::AttachCurrentThread(); 59 JNIEnv* env = base::android::AttachCurrentThread();
53 Java_SnippetsLauncher_destroy(env, java_launcher_); 60 Java_SnippetsLauncher_destroy(env, java_launcher_);
54 java_launcher_.Reset(); 61 java_launcher_.Reset();
55 } 62 }
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_launcher.h ('k') | components/ntp_snippets/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698