Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / browser / ui / android / tab_model / single_tab_model.cc
blob2aaa1aec6f6d33670a0d0da1830c34d51e3d6228
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/android/tab_model/single_tab_model.h"
7 #include "base/android/jni_android.h"
8 #include "chrome/browser/android/tab_android.h"
9 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h"
10 #include "content/public/browser/web_contents.h"
11 #include "jni/SingleTabModel_jni.h"
13 static void PermanentlyBlockAllNewWindows(JNIEnv* env,
14 jclass clazz,
15 jobject j_tab_android) {
16 TabAndroid* tab = TabAndroid::GetNativeTab(env, j_tab_android);
17 if (!tab)
18 return;
20 content::WebContents* web_contents = tab->web_contents();
21 if (!web_contents)
22 return;
24 SingleTabModeTabHelper* tab_helper =
25 SingleTabModeTabHelper::FromWebContents(web_contents);
26 tab_helper->PermanentlyBlockAllNewWindows();
29 // Register native methods
30 bool RegisterSingleTabModel(JNIEnv* env) {
31 return RegisterNativesImpl(env);