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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java

Issue 2966383004: Adjust view for the password exceptions in the new UI (Closed)
Patch Set: adressed comments Created 3 years, 5 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
« no previous file with comments | « chrome/android/java/res/layout/password_entry_exception.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java
index cdf82a92181ec78a0130d7f5f553758f46af32be..f7d3275a0884368478f180e9479e4fb48be22d78 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordEntryEditor.java
@@ -66,14 +66,6 @@ public class PasswordEntryEditor extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- if (shouldDisplayInteractivePasswordEntryEditor()) {
- mView = inflater.inflate(R.layout.password_entry_editor_interactive, container, false);
- } else {
- mView = inflater.inflate(R.layout.password_entry_editor, container, false);
- }
- getActivity().setTitle(R.string.password_entry_editor_title);
- mClipboard = (ClipboardManager) getActivity().getApplicationContext().getSystemService(
- Context.CLIPBOARD_SERVICE);
// Extras are set on this intent in class {@link SavePasswordsPreferences}.
mExtras = getArguments();
assert mExtras != null;
@@ -81,12 +73,28 @@ public class PasswordEntryEditor extends Fragment {
final String name = mExtras.containsKey(SavePasswordsPreferences.PASSWORD_LIST_NAME)
? mExtras.getString(SavePasswordsPreferences.PASSWORD_LIST_NAME)
: null;
+
+ mException = (name == null);
+ if (shouldDisplayInteractivePasswordEntryEditor()) {
+ if (!mException) {
+ mView = inflater.inflate(
+ R.layout.password_entry_editor_interactive, container, false);
+ } else {
+ mView = inflater.inflate(R.layout.password_entry_exception, container, false);
+ }
+ } else {
+ mView = inflater.inflate(R.layout.password_entry_editor, container, false);
+ }
+ getActivity().setTitle(R.string.password_entry_editor_title);
+ mClipboard = (ClipboardManager) getActivity().getApplicationContext().getSystemService(
+ Context.CLIPBOARD_SERVICE);
TextView nameView = (TextView) mView.findViewById(R.id.password_entry_editor_name);
- if (name != null) {
+ if (!mException) {
nameView.setText(name);
} else {
- nameView.setText(R.string.section_saved_passwords_exceptions);
- mException = true;
+ if (!shouldDisplayInteractivePasswordEntryEditor()) {
+ nameView.setText(R.string.section_saved_passwords_exceptions);
+ }
}
final String url = mExtras.getString(SavePasswordsPreferences.PASSWORD_LIST_URL);
TextView urlView = (TextView) mView.findViewById(R.id.password_entry_editor_url);
@@ -95,9 +103,11 @@ public class PasswordEntryEditor extends Fragment {
mKeyguardManager =
(KeyguardManager) getActivity().getApplicationContext().getSystemService(
Context.KEYGUARD_SERVICE);
- hidePassword();
- hookupPasswordButtons();
- hookupCopyUsernameButton();
+ if (!mException) {
+ hidePassword();
+ hookupPasswordButtons();
+ hookupCopyUsernameButton();
+ }
hookupCopySiteButton();
} else {
hookupCancelDeleteButtons();
« no previous file with comments | « chrome/android/java/res/layout/password_entry_exception.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698