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

Unified Diff: content/browser/frame_host/render_frame_host_android.cc

Issue 2769993002: Restrict getInstalledRelatedApps() to non-incognito contexts. (Closed)
Patch Set: Created 3 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: content/browser/frame_host/render_frame_host_android.cc
diff --git a/content/browser/frame_host/render_frame_host_android.cc b/content/browser/frame_host/render_frame_host_android.cc
index aa84f8139b0471f483093aaeee03907a37947080..ce594fef91767ad17678b159366603c0753c5132 100644
--- a/content/browser/frame_host/render_frame_host_android.cc
+++ b/content/browser/frame_host/render_frame_host_android.cc
@@ -8,6 +8,8 @@
#include "base/logging.h"
#include "content/browser/frame_host/render_frame_host_delegate.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/site_instance.h"
#include "jni/RenderFrameHostImpl_jni.h"
using base::android::AttachCurrentThread;
@@ -55,4 +57,12 @@ ScopedJavaLocalRef<jstring> RenderFrameHostAndroid::GetLastCommittedURL(
env, render_frame_host_->GetLastCommittedURL().spec());
}
+jboolean RenderFrameHostAndroid::IsIncognito(
boliu 2017/03/23 18:12:51 I feel RFH has no business exposing whether it's I
Timothy Loh 2017/03/24 03:11:31 For now I added a comment in the header file -- I'
boliu 2017/03/24 03:54:49 Can skip SiteInstance if there is no need. This i
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj) const {
+ return render_frame_host_->GetSiteInstance()
+ ->GetBrowserContext()
+ ->IsOffTheRecord();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698