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

Unified Diff: chrome/browser/ui/autofill/popup_view_utils.h

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/popup_view_utils.h
diff --git a/chrome/browser/ui/autofill/popup_view_utils.h b/chrome/browser/ui/autofill/popup_view_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a6c6705c2f8167f366d04a19708525f2b1c74af
--- /dev/null
+++ b/chrome/browser/ui/autofill/popup_view_utils.h
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_AUTOFILL_POPUP_VIEW_UTILS_H_
+#define CHROME_BROWSER_UI_AUTOFILL_POPUP_VIEW_UTILS_H_
+
+#include "base/macros.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace gfx {
+class Display;
+class Point;
+class Rect;
+}
+
+namespace autofill {
+namespace view_utils {
+
+// Provides utility functions for popup views.
+class PopupViewUtils {
+ public:
+ // Returns the bounds that the popup should be placed at, given the desired
+ // width and height. By default this places the popup below |element_bounds|
+ // but it will be placed above if there isn't enough space.
+ gfx::Rect CalculatePopupBounds(int desired_width,
+ int desired_height,
+ const gfx::Rect& element_bounds,
+ gfx::NativeView container_view,
+ bool is_rtl);
+
+ protected:
+ // A helper function to get the display closest to the given point (virtual
+ // for testing).
+ virtual gfx::Display GetDisplayNearestPoint(const gfx::Point& point,
+ gfx::NativeView container_view);
+};
+} // namespace view_utils
+} // namespace autofill
+
+#endif // CHROME_BROWSER_UI_AUTOFILL_POPUP_VIEW_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698