Lines Matching defs:button

5 #include "ui/views/controls/button/custom_button.h"
13 #include "ui/views/controls/button/checkbox.h"
14 #include "ui/views/controls/button/image_button.h"
15 #include "ui/views/controls/button/label_button.h"
16 #include "ui/views/controls/button/menu_button.h"
17 #include "ui/views/controls/button/radio_button.h"
38 void PerformGesture(CustomButton* button, ui::EventType event_type) {
42 button->OnGestureEvent(&gesture_event);
70 TestCustomButton* button = new TestCustomButton(NULL);
71 widget->SetContentsView(button);
74 button->OnMousePressed(ui::MouseEvent(ui::ET_MOUSE_PRESSED, center, center,
77 EXPECT_EQ(CustomButton::STATE_PRESSED, button->state());
79 button->OnMouseReleased(ui::MouseEvent(ui::ET_MOUSE_RELEASED, center, center,
82 EXPECT_EQ(CustomButton::STATE_HOVERED, button->state());
84 button->SetEnabled(false);
85 EXPECT_EQ(CustomButton::STATE_DISABLED, button->state());
87 button->SetEnabled(true);
88 EXPECT_EQ(CustomButton::STATE_HOVERED, button->state());
90 button->SetVisible(false);
91 EXPECT_EQ(CustomButton::STATE_NORMAL, button->state());
93 button->SetVisible(true);
94 EXPECT_EQ(CustomButton::STATE_HOVERED, button->state());
100 button->SetEnabled(false);
101 EXPECT_EQ(CustomButton::STATE_DISABLED, button->state());
103 button->SetEnabled(true);
104 EXPECT_EQ(CustomButton::STATE_NORMAL, button->state());
106 button->SetVisible(false);
107 EXPECT_EQ(CustomButton::STATE_NORMAL, button->state());
109 button->SetVisible(true);
110 EXPECT_EQ(CustomButton::STATE_NORMAL, button->state());
113 // Tests that gesture events correctly change the button state.
127 TestCustomButton* button = new TestCustomButton(NULL);
128 widget->SetContentsView(button);
130 EXPECT_EQ(CustomButton::STATE_NORMAL, button->state());
132 PerformGesture(button, ui::ET_GESTURE_TAP_DOWN);
133 EXPECT_EQ(CustomButton::STATE_PRESSED, button->state());
135 PerformGesture(button, ui::ET_GESTURE_SHOW_PRESS);
136 EXPECT_EQ(CustomButton::STATE_PRESSED, button->state());
138 PerformGesture(button, ui::ET_GESTURE_TAP_CANCEL);
139 EXPECT_EQ(CustomButton::STATE_NORMAL, button->state());