OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/views/passwords/manage_passwords_bubble_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 } | 953 } |
954 | 954 |
955 void ManagePasswordsBubbleView::Close() { | 955 void ManagePasswordsBubbleView::Close() { |
956 mouse_handler_.reset(); | 956 mouse_handler_.reset(); |
957 ManagedFullScreenBubbleDelegateView::Close(); | 957 ManagedFullScreenBubbleDelegateView::Close(); |
958 } | 958 } |
959 | 959 |
960 void ManagePasswordsBubbleView::Refresh() { | 960 void ManagePasswordsBubbleView::Refresh() { |
961 RemoveAllChildViews(true); | 961 RemoveAllChildViews(true); |
962 initially_focused_view_ = NULL; | 962 initially_focused_view_ = NULL; |
963 if (password_manager::ui::IsPendingState(model()->state())) { | 963 if (model()->state() == password_manager::ui::PENDING_PASSWORD_STATE) { |
964 if (model()->never_save_passwords()) | 964 if (model()->never_save_passwords()) |
965 AddChildView(new ConfirmNeverView(this)); | 965 AddChildView(new ConfirmNeverView(this)); |
966 else | 966 else |
967 AddChildView(new PendingView(this)); | 967 AddChildView(new PendingView(this)); |
968 } else if (IsAskSubmitURLState(model()->state())) { | 968 } else if (IsAskSubmitURLState(model()->state())) { |
969 AddChildView(new AskUserToSubmitURLView(this)); | 969 AddChildView(new AskUserToSubmitURLView(this)); |
970 } else if (model()->state() == password_manager::ui::BLACKLIST_STATE) { | 970 } else if (model()->state() == password_manager::ui::BLACKLIST_STATE) { |
971 AddChildView(new BlacklistedView(this)); | 971 AddChildView(new BlacklistedView(this)); |
972 } else if (model()->state() == password_manager::ui::CONFIRMATION_STATE) { | 972 } else if (model()->state() == password_manager::ui::CONFIRMATION_STATE) { |
973 AddChildView(new SaveConfirmationView(this)); | 973 AddChildView(new SaveConfirmationView(this)); |
974 } else if (password_manager::ui::IsCredentialsState(model()->state())) { | 974 } else if (model()->state() == |
| 975 password_manager::ui::CREDENTIAL_REQUEST_STATE) { |
975 AddChildView(new AccountChooserView(this)); | 976 AddChildView(new AccountChooserView(this)); |
976 } else { | 977 } else { |
977 AddChildView(new ManageView(this)); | 978 AddChildView(new ManageView(this)); |
978 } | 979 } |
979 GetLayoutManager()->Layout(this); | 980 GetLayoutManager()->Layout(this); |
980 } | 981 } |
981 | 982 |
982 void ManagePasswordsBubbleView::NotifyConfirmedNeverForThisSite() { | 983 void ManagePasswordsBubbleView::NotifyConfirmedNeverForThisSite() { |
983 model()->OnNeverForThisSiteClicked(); | 984 model()->OnNeverForThisSiteClicked(); |
984 Close(); | 985 Close(); |
985 } | 986 } |
986 | 987 |
987 void ManagePasswordsBubbleView::NotifyUndoNeverForThisSite() { | 988 void ManagePasswordsBubbleView::NotifyUndoNeverForThisSite() { |
988 model()->OnUndoNeverForThisSite(); | 989 model()->OnUndoNeverForThisSite(); |
989 Refresh(); | 990 Refresh(); |
990 } | 991 } |
991 | 992 |
992 void ManagePasswordsBubbleView::NotifyNeverForThisSiteClicked() { | 993 void ManagePasswordsBubbleView::NotifyNeverForThisSiteClicked() { |
993 if (model()->best_matches().empty()) { | 994 if (model()->best_matches().empty()) { |
994 // Skip confirmation if there are no existing passwords for this site. | 995 // Skip confirmation if there are no existing passwords for this site. |
995 NotifyConfirmedNeverForThisSite(); | 996 NotifyConfirmedNeverForThisSite(); |
996 } else { | 997 } else { |
997 model()->OnConfirmationForNeverForThisSite(); | 998 model()->OnConfirmationForNeverForThisSite(); |
998 Refresh(); | 999 Refresh(); |
999 } | 1000 } |
1000 } | 1001 } |
OLD | NEW |