Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.chrome.browser.ntp; | 5 package org.chromium.chrome.browser.ntp; |
| 6 | 6 |
| 7 import org.chromium.base.annotations.CalledByNative; | 7 import org.chromium.base.annotations.CalledByNative; |
| 8 import org.chromium.chrome.browser.profiles.Profile; | 8 import org.chromium.chrome.browser.profiles.Profile; |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Retrieve the user's interests. | 11 * Retrieve the user's interests. |
| 12 */ | 12 */ |
| 13 public class InterestsService { | 13 public class InterestsService { |
| 14 public static final String AUTH_SCOPE = | |
| 15 "https://www.googleapis.com/auth/googlenow"; | |
|
Marc Treib
2015/09/18 13:26:04
Hm. Shouldn't the InterestsService itself (probabl
tache
2015/09/21 15:35:55
I don't think so. Looking at the OAuth2TokenServic
Marc Treib
2015/09/21 16:20:08
The native ProfileOAuth2TokenService works on all
| |
| 16 | |
| 14 private long mNativeInterestsService; | 17 private long mNativeInterestsService; |
| 15 | 18 |
| 16 /** | 19 /** |
| 17 * A user's interest. | 20 * A user's interest. |
| 18 */ | 21 */ |
| 19 public static class Interest { | 22 public static class Interest { |
| 20 private String mName; | 23 private String mName; |
| 21 private String mImageUrl; | 24 private String mImageUrl; |
| 22 private double mRelevance; | 25 private double mRelevance; |
| 23 | 26 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 @CalledByNative | 94 @CalledByNative |
| 92 public static Interest createInterest(String name, String imageUrl, double r elevance) { | 95 public static Interest createInterest(String name, String imageUrl, double r elevance) { |
| 93 return new Interest(name, imageUrl, relevance); | 96 return new Interest(name, imageUrl, relevance); |
| 94 } | 97 } |
| 95 | 98 |
| 96 private native long nativeInit(Profile profile); | 99 private native long nativeInit(Profile profile); |
| 97 private native void nativeDestroy(long nativeInterestsService); | 100 private native void nativeDestroy(long nativeInterestsService); |
| 98 private native void nativeGetInterests( | 101 private native void nativeGetInterests( |
| 99 long nativeInterestsService, String token, GetInterestsCallback call back); | 102 long nativeInterestsService, String token, GetInterestsCallback call back); |
| 100 } | 103 } |
| OLD | NEW |