OLD | NEW |
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/password_manager/auto_signin_first_run_dialog_android.h
" | 5 #include "chrome/browser/password_manager/auto_signin_first_run_dialog_android.h
" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 9 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 Profile* profile = | 38 Profile* profile = |
39 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 39 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
40 | 40 |
41 bool is_smartlock_branding_enabled = | 41 bool is_smartlock_branding_enabled = |
42 password_bubble_experiment::IsSmartLockUser( | 42 password_bubble_experiment::IsSmartLockUser( |
43 ProfileSyncServiceFactory::GetForProfile(profile)); | 43 ProfileSyncServiceFactory::GetForProfile(profile)); |
44 base::string16 explanation; | 44 base::string16 explanation; |
45 gfx::Range explanation_link_range = gfx::Range(); | 45 gfx::Range explanation_link_range = gfx::Range(); |
46 GetBrandedTextAndLinkRange( | 46 GetBrandedTextAndLinkRange( |
47 is_smartlock_branding_enabled, | 47 is_smartlock_branding_enabled, |
48 IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_SMART_LOCK_WELCOME, | 48 IDS_AUTO_SIGNIN_FIRST_RUN_SMART_LOCK_TEXT, |
49 IDS_MANAGE_PASSWORDS_AUTO_SIGNIN_DEFAULT_WELCOME, &explanation, | 49 IDS_AUTO_SIGNIN_FIRST_RUN_TEXT, &explanation, |
50 &explanation_link_range); | 50 &explanation_link_range); |
51 gfx::NativeWindow native_window = web_contents_->GetTopLevelNativeWindow(); | 51 gfx::NativeWindow native_window = web_contents_->GetTopLevelNativeWindow(); |
52 base::android::ScopedJavaGlobalRef<jobject> java_dialog_global; | 52 base::android::ScopedJavaGlobalRef<jobject> java_dialog_global; |
53 base::string16 message = l10n_util::GetStringUTF16( | 53 base::string16 message = l10n_util::GetStringUTF16( |
54 IsSyncingSettings(profile) | 54 IsSyncingSettings(profile) |
55 ? IDS_AUTO_SIGNIN_FIRST_RUN_TITLE_MANY_DEVICES | 55 ? IDS_AUTO_SIGNIN_FIRST_RUN_TITLE_MANY_DEVICES |
56 : IDS_AUTO_SIGNIN_FIRST_RUN_TITLE_LOCAL_DEVICE); | 56 : IDS_AUTO_SIGNIN_FIRST_RUN_TITLE_LOCAL_DEVICE); |
57 base::string16 ok_button_text = | 57 base::string16 ok_button_text = |
58 l10n_util::GetStringUTF16(IDS_AUTO_SIGNIN_FIRST_RUN_OK); | 58 l10n_util::GetStringUTF16(IDS_AUTO_SIGNIN_FIRST_RUN_OK); |
59 base::string16 turn_off_button_text = | 59 base::string16 turn_off_button_text = |
(...skipping 27 matching lines...) Expand all Loading... |
87 void AutoSigninFirstRunDialogAndroid::OnLinkClicked(JNIEnv* env, jobject obj) { | 87 void AutoSigninFirstRunDialogAndroid::OnLinkClicked(JNIEnv* env, jobject obj) { |
88 web_contents_->OpenURL(content::OpenURLParams( | 88 web_contents_->OpenURL(content::OpenURLParams( |
89 GURL(password_manager::kPasswordManagerHelpCenterSmartLock), | 89 GURL(password_manager::kPasswordManagerHelpCenterSmartLock), |
90 content::Referrer(), NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 90 content::Referrer(), NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
91 false /* is_renderer_initiated */)); | 91 false /* is_renderer_initiated */)); |
92 } | 92 } |
93 | 93 |
94 bool RegisterAutoSigninFirstRunDialogAndroid(JNIEnv* env) { | 94 bool RegisterAutoSigninFirstRunDialogAndroid(JNIEnv* env) { |
95 return RegisterNativesImpl(env); | 95 return RegisterNativesImpl(env); |
96 } | 96 } |
OLD | NEW |