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

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

Issue 21724002: rAc: try really hard not to ellipsize addresses (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 7 years, 4 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/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 d076667094cb8633465be9bd7df763bd0944b7be..a3aef00e80e865e80420014f60f341b1f3a83549 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.h
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.h
@@ -11,6 +11,7 @@
#include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h"
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
+#include "chrome/browser/ui/autofill/autofill_dialog_types.h"
#include "chrome/browser/ui/autofill/autofill_dialog_view.h"
#include "chrome/browser/ui/autofill/testable_autofill_dialog_view.h"
#include "ui/base/animation/animation_delegate.h"
@@ -60,7 +61,6 @@ namespace autofill {
class AutofillDialogSignInDelegate;
class DecoratedTextfield;
-struct DetailInput;
// Views toolkit implementation of the Autofill dialog that handles the
// imperative autocomplete API call.
@@ -380,33 +380,46 @@ class AutofillDialogViews : public AutofillDialogView,
// edit the suggestion.
class SuggestionView : public views::View {
public:
- SuggestionView(const base::string16& edit_label,
- AutofillDialogViews* autofill_dialog);
+ explicit SuggestionView(AutofillDialogViews* autofill_dialog);
virtual ~SuggestionView();
+ void SetState(const SuggestionState& state);
+
+ // views::View implementation.
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual int GetHeightForWidth(int w) OVERRIDE;
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+
+ DecoratedTextfield* decorated_textfield() { return decorated_; }
+
+ private:
+ bool CanUseVerticallyCompactText(int available_width,
+ int* resulting_height);
+
// Sets the display text of the suggestion.
- void SetSuggestionText(const base::string16& text,
- gfx::Font::FontStyle style);
+ void SetLabelText(const base::string16& text);
// Sets the icon which should be displayed ahead of the text.
- void SetSuggestionIcon(const gfx::Image& image);
+ void SetIcon(const gfx::Image& image);
// Shows an auxiliary textfield to the right of the suggestion icon and
// text. This is currently only used to show a CVC field for the CC section.
- void ShowTextfield(const base::string16& placeholder_text,
- const gfx::Image& icon);
+ void SetTextfield(const base::string16& placeholder_text,
+ const gfx::Image& icon);
- DecoratedTextfield* decorated_textfield() { return decorated_; }
+ // The state of |this|.
+ SuggestionState state_;
+
+ // This caches preferred heights for given widths. The key is a preferred
+ // width, the value is a cached result of CanUseVerticallyCompactText.
+ std::map<int, std::pair<bool, int> > calculated_heights_;
- private:
// The label that holds the suggestion description text.
views::Label* label_;
// The second (and greater) line of text that describes the suggestion.
views::Label* label_line_2_;
// The icon that comes just before |label_|.
views::ImageView* icon_;
- // A view to contain |label_| and |icon_|.
- views::View* label_container_;
// The input set by ShowTextfield.
DecoratedTextfield* decorated_;
// An "Edit" link that flips to editable inputs rather than suggestion text.

Powered by Google App Engine
This is Rietveld 408576698