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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/autofill_dialog_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; 391 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE;
392 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 392 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
393 393
394 private: 394 private:
395 // Returns the corred resource ID (i.e. IDR_*) for the current |state()|. 395 // Returns the corred resource ID (i.e. IDR_*) for the current |state()|.
396 int ResourceIDForState() const; 396 int ResourceIDForState() const;
397 397
398 DISALLOW_COPY_AND_ASSIGN(SuggestedButton); 398 DISALLOW_COPY_AND_ASSIGN(SuggestedButton);
399 }; 399 };
400 400
401 // A view that runs a callback whenever its bounds change, and which can
402 // optionally suppress layout.
403 class DetailsContainerView : public views::View {
404 public:
405 explicit DetailsContainerView(const base::Closure& callback);
406 virtual ~DetailsContainerView();
407
408 void set_ignore_layouts(bool ignore_layouts) {
409 ignore_layouts_ = ignore_layouts;
410 }
411
412 // views::View implementation.
413 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
414 virtual void Layout() OVERRIDE;
415
416 private:
417 base::Closure bounds_changed_callback_;
418
419 // The view ignores Layout() calls when this is true.
420 bool ignore_layouts_;
421
422 DISALLOW_COPY_AND_ASSIGN(DetailsContainerView);
423 };
424
401 // A view that contains a suggestion (such as a known address) and a link to 425 // A view that contains a suggestion (such as a known address) and a link to
402 // edit the suggestion. 426 // edit the suggestion.
403 class SuggestionView : public views::View { 427 class SuggestionView : public views::View {
404 public: 428 public:
405 explicit SuggestionView(AutofillDialogViews* autofill_dialog); 429 explicit SuggestionView(AutofillDialogViews* autofill_dialog);
406 virtual ~SuggestionView(); 430 virtual ~SuggestionView();
407 431
408 void SetState(const SuggestionState& state); 432 void SetState(const SuggestionState& state);
409 433
410 // views::View implementation. 434 // views::View implementation.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 AccountChooser* account_chooser_; 629 AccountChooser* account_chooser_;
606 630
607 // A WebView to that navigates to a Google sign-in page to allow the user to 631 // A WebView to that navigates to a Google sign-in page to allow the user to
608 // sign-in. 632 // sign-in.
609 views::WebView* sign_in_webview_; 633 views::WebView* sign_in_webview_;
610 634
611 // View that wraps |details_container_| and makes it scroll vertically. 635 // View that wraps |details_container_| and makes it scroll vertically.
612 views::ScrollView* scrollable_area_; 636 views::ScrollView* scrollable_area_;
613 637
614 // View to host details sections. 638 // View to host details sections.
615 views::View* details_container_; 639 DetailsContainerView* details_container_;
616 640
617 // A view that overlays |this| (for "loading..." messages). 641 // A view that overlays |this| (for "loading..." messages).
618 views::View* loading_shield_; 642 views::View* loading_shield_;
619 643
620 // The view that completely overlays the dialog (used for the splash page). 644 // The view that completely overlays the dialog (used for the splash page).
621 OverlayView* overlay_view_; 645 OverlayView* overlay_view_;
622 646
623 // The "Extra view" is on the same row as the dialog buttons. 647 // The "Extra view" is on the same row as the dialog buttons.
624 views::View* button_strip_extra_view_; 648 views::View* button_strip_extra_view_;
625 649
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 681
658 // Delegate for the sign-in dialog's webview. 682 // Delegate for the sign-in dialog's webview.
659 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_; 683 scoped_ptr<AutofillDialogSignInDelegate> sign_in_delegate_;
660 684
661 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews); 685 DISALLOW_COPY_AND_ASSIGN(AutofillDialogViews);
662 }; 686 };
663 687
664 } // namespace autofill 688 } // namespace autofill
665 689
666 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_ 690 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_DIALOG_VIEWS_H_
OLDNEW
« 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