-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3459 from brave/show_real_brave_stats_on_android_ntp
Show real brave stats on brave NTP
- Loading branch information
Showing
4 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/build/android/jni_headers/BraveNewTabPageView_jni.h" | ||
|
||
#include "brave/common/pref_names.h" | ||
#include "chrome/browser/profiles/profile.h" | ||
#include "chrome/browser/profiles/profile_android.h" | ||
#include "components/prefs/pref_service.h" | ||
|
||
namespace chrome { | ||
namespace android { | ||
|
||
int JNI_BraveNewTabPageView_GetTrackersBlockedCount( | ||
JNIEnv* env, | ||
const base::android::JavaParamRef<jobject>& j_profile) { | ||
Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); | ||
return profile->GetPrefs()->GetUint64(kTrackersBlocked); | ||
} | ||
|
||
int JNI_BraveNewTabPageView_GetAdsBlockedCount( | ||
JNIEnv* env, | ||
const base::android::JavaParamRef<jobject>& j_profile) { | ||
Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); | ||
return profile->GetPrefs()->GetUint64(kAdsBlocked); | ||
} | ||
|
||
int JNI_BraveNewTabPageView_GetHttpsUpgradesCount( | ||
JNIEnv* env, | ||
const base::android::JavaParamRef<jobject>& j_profile) { | ||
Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); | ||
return profile->GetPrefs()->GetUint64(kHttpsUpgrades); | ||
} | ||
|
||
} // namespace android | ||
} // namespace chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters