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

Unified Diff: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc

Issue 11817051: Elide text in the new Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_popup_view_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
index 268f329e13f003d170e9ca7b72f267e3794a4a4b..e48df09946d2374155a6f7a381211512261db62d 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
@@ -10,11 +10,9 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/display.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
-#include "ui/gfx/screen.h"
#include "ui/views/border.h"
#include "ui/views/widget/widget.h"
@@ -135,7 +133,6 @@ void AutofillPopupViewViews::Show() {
set_border(views::Border::CreateSolidBorder(kBorderThickness, kBorderColor));
- SetInitialBounds();
UpdateBoundsAndRedrawPopup();
}
@@ -215,37 +212,6 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
gfx::Canvas::TEXT_ALIGN_CENTER);
}
-void AutofillPopupViewViews::SetInitialBounds() {
- int bottom_of_field = controller_->element_bounds().bottom();
- int popup_height = controller_->GetPopupRequiredHeight();
-
- // Find the correct top position of the popup so that it doesn't go off
- // the screen.
- int top_of_popup = 0;
- if (GetScreenSize().height() < bottom_of_field + popup_height) {
- // The popup must appear above the field.
- top_of_popup = controller_->element_bounds().y() - popup_height;
- } else {
- // The popup can appear below the field.
- top_of_popup = bottom_of_field;
- }
-
- controller_->SetPopupBounds(gfx::Rect(
- controller_->element_bounds().x(),
- top_of_popup,
- controller_->GetPopupRequiredWidth(),
- popup_height));
-}
-
-gfx::Size AutofillPopupViewViews::GetScreenSize() {
- gfx::Screen* screen =
- gfx::Screen::GetScreenFor(controller_->container_view());
- gfx::Display display =
- screen->GetDisplayNearestPoint(controller_->element_bounds().origin());
-
- return display.GetSizeInPixel();
-}
-
AutofillPopupView* AutofillPopupView::Create(
AutofillPopupController* controller) {
return new AutofillPopupViewViews(controller);
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_popup_view_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698