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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.h

Issue 23526021: rAc: reduce number of redundant layouts of DetailsContainerView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | chrome/browser/ui/views/autofill/autofill_dialog_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/autofill_dialog_views.h
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.h b/chrome/browser/ui/views/autofill/autofill_dialog_views.h
index b32c2653bb5a1c7c3b745e8c5efe5cde2a1337a8..494207dfa4759f675012ade748fdf120cc0c81a4 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.h
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.h
@@ -398,6 +398,30 @@ class AutofillDialogViews : public AutofillDialogView,
DISALLOW_COPY_AND_ASSIGN(SuggestedButton);
};
+ // A view that runs a callback whenever its bounds change, and which can
+ // optionally suppress layout.
+ class DetailsContainerView : public views::View {
+ public:
+ explicit DetailsContainerView(const base::Closure& callback);
+ virtual ~DetailsContainerView();
+
+ void set_ignore_layouts(bool ignore_layouts) {
+ ignore_layouts_ = ignore_layouts;
+ }
+
+ // views::View implementation.
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void Layout() OVERRIDE;
+
+ private:
+ base::Closure bounds_changed_callback_;
+
+ // The view ignores Layout() calls when this is true.
+ bool ignore_layouts_;
+
+ DISALLOW_COPY_AND_ASSIGN(DetailsContainerView);
+ };
+
// A view that contains a suggestion (such as a known address) and a link to
// edit the suggestion.
class SuggestionView : public views::View {
@@ -612,7 +636,7 @@ class AutofillDialogViews : public AutofillDialogView,
views::ScrollView* scrollable_area_;
// View to host details sections.
- views::View* details_container_;
+ DetailsContainerView* details_container_;
// A view that overlays |this| (for "loading..." messages).
views::View* loading_shield_;
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/autofill_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698