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

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

Issue 11785035: Continue work on requestAutocomplete dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync 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 | « 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 b72738a1dbdd9ca8eda618e225af268017a13035..83e4603fb1de68a34d69caeb05a2270c136de7fa 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.h
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.h
@@ -18,8 +18,8 @@ class ConstrainedWindowViews;
namespace views {
class Checkbox;
class Combobox;
+class ImageButton;
class Label;
-class MenuButton;
class MenuRunner;
class Textfield;
}
@@ -38,7 +38,6 @@ struct DetailInput;
class AutofillDialogViews : public AutofillDialogView,
public views::DialogDelegate,
public views::ButtonListener,
- public views::MenuButtonListener,
public views::TextfieldController,
public views::FocusChangeListener {
public:
@@ -68,10 +67,6 @@ class AutofillDialogViews : public AutofillDialogView,
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
- // views::MenuButtonListener implementation:
- virtual void OnMenuButtonClicked(views::View* source,
- const gfx::Point& point) OVERRIDE;
-
// views::TextfieldController implementation:
virtual void ContentsChanged(views::Textfield* sender,
const string16& new_contents) OVERRIDE;
@@ -88,6 +83,37 @@ class AutofillDialogViews : public AutofillDialogView,
typedef std::map<const DetailInput*, views::Textfield*> TextfieldMap;
typedef std::map<const DetailInput*, views::Combobox*> ComboboxMap;
+ // A view that packs a label on the left and some related controls
+ // on the right.
+ class SectionContainer : public views::View {
+ public:
+ SectionContainer(const string16& label,
+ views::View* controls,
+ views::Button* proxy_button);
+ virtual ~SectionContainer();
+
+ // Sets whether mouse events should be forwarded to |proxy_button_|.
+ void SetForwardMouseEvents(bool forward);
+
+ // views::View implementation.
+ virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
+
+ private:
+ // Converts |event| to one suitable for |proxy_button_|.
+ static ui::MouseEvent ProxyEvent(const ui::MouseEvent& event);
+
+ // Mouse events on |this| are sent to this button.
+ views::Button* proxy_button_; // Weak reference.
+
+ // When true, mouse events will be forwarded to |proxy_button_|.
+ bool forward_mouse_events_;
+
+ DISALLOW_COPY_AND_ASSIGN(SectionContainer);
+ };
+
// A convenience struct for holding pointers to views within each detail
// section. None of the member pointers are owned.
struct DetailsGroup {
@@ -97,7 +123,7 @@ class AutofillDialogViews : public AutofillDialogView,
// The section this group is associated with.
const DialogSection section;
// The view that contains the entire section (label + input).
- views::View* container;
+ SectionContainer* container;
// The view that allows manual input.
views::View* manual_input;
// The textfields in |manual_input|, tracked by their DetailInput.
@@ -108,7 +134,7 @@ class AutofillDialogViews : public AutofillDialogView,
// visible IFF |manual_input| is not visible.
views::Label* suggested_info;
// The view that allows selecting other data suggestions.
- views::MenuButton* suggested_button;
+ views::ImageButton* suggested_button;
};
void InitChildViews();
« 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