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

Unified Diff: chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc

Issue 1570783003: [Autofill] Move functions from the AutofillPopupController to AutofillPopupLayoutModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AutofillPopupViewHelper Created 4 years, 11 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: chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
index 451d67d37781c6e2ad1fde5361e46e0fe0fe3a29..56a07b891f4eba2a565881b6d6b692d0c3457ae1 100644
--- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
@@ -25,6 +25,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/core/browser/password_generator.h"
+#include "components/autofill/core/browser/suggestion.h"
#include "components/browser_sync/browser/profile_sync_service.h"
#include "components/password_manager/core/browser/password_bubble_experiment.h"
#include "components/password_manager/core/browser/password_manager.h"
@@ -174,14 +175,15 @@ int PasswordGenerationPopupControllerImpl::GetMinimumWidth() {
// If the width of the field is longer than the minimum, use that instead.
return std::max(minimum_width,
- controller_common_.RoundedElementBounds().width());
+ gfx::ToEnclosingRect(element_bounds()).width());
}
void PasswordGenerationPopupControllerImpl::CalculateBounds() {
gfx::Size bounds = view_->GetPreferredSizeOfPasswordView();
- popup_bounds_ = controller_common_.GetPopupBounds(bounds.width(),
- bounds.height());
+ popup_bounds_ = view_utils_.CalculatePopupBounds(
+ bounds.width(), bounds.height(), gfx::ToEnclosingRect(element_bounds()),
+ container_view(), IsRTL());
}
void PasswordGenerationPopupControllerImpl::Show(bool display_password) {
@@ -264,7 +266,7 @@ gfx::NativeView PasswordGenerationPopupControllerImpl::container_view() {
return controller_common_.container_view();
}
-const gfx::Rect& PasswordGenerationPopupControllerImpl::popup_bounds() const {
+gfx::Rect PasswordGenerationPopupControllerImpl::popup_bounds() const {
return popup_bounds_;
}
@@ -277,6 +279,26 @@ bool PasswordGenerationPopupControllerImpl::IsRTL() const {
return base::i18n::IsRTL();
}
+// Autofill-specific method returns nothing.
+const std::vector<autofill::Suggestion>
+PasswordGenerationPopupControllerImpl::GetSuggestions() {
+ return std::vector<autofill::Suggestion>();
+}
+
+#if !defined(OS_ANDROID)
+// Autofill-specific method returns nothing.
+int PasswordGenerationPopupControllerImpl::GetElidedValueWidthForRow(
+ size_t row) {
+ return 0;
+}
+
+// Autofill-specific method returns nothing.
+int PasswordGenerationPopupControllerImpl::GetElidedLabelWidthForRow(
+ size_t row) {
+ return 0;
+}
+#endif
+
bool PasswordGenerationPopupControllerImpl::display_password() const {
return display_password_;
}

Powered by Google App Engine
This is Rietveld 408576698