| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/views/controls/combobox/combobox.h" | 5 #include "ui/views/controls/combobox/combobox.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 input_method_->DispatchKeyEvent(event); | 213 input_method_->DispatchKeyEvent(event); |
| 214 } | 214 } |
| 215 | 215 |
| 216 View* GetFocusedView() { | 216 View* GetFocusedView() { |
| 217 return widget_->GetFocusManager()->GetFocusedView(); | 217 return widget_->GetFocusManager()->GetFocusedView(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void PerformClick(const gfx::Point& point) { | 220 void PerformClick(const gfx::Point& point) { |
| 221 ui::MouseEvent pressed_event = ui::MouseEvent(ui::ET_MOUSE_PRESSED, point, | 221 ui::MouseEvent pressed_event = ui::MouseEvent(ui::ET_MOUSE_PRESSED, point, |
| 222 point, | 222 point, |
| 223 ui::EF_LEFT_MOUSE_BUTTON, |
| 223 ui::EF_LEFT_MOUSE_BUTTON); | 224 ui::EF_LEFT_MOUSE_BUTTON); |
| 224 widget_->OnMouseEvent(&pressed_event); | 225 widget_->OnMouseEvent(&pressed_event); |
| 225 ui::MouseEvent released_event = ui::MouseEvent(ui::ET_MOUSE_RELEASED, point, | 226 ui::MouseEvent released_event = ui::MouseEvent(ui::ET_MOUSE_RELEASED, point, |
| 226 point, | 227 point, |
| 228 ui::EF_LEFT_MOUSE_BUTTON, |
| 227 ui::EF_LEFT_MOUSE_BUTTON); | 229 ui::EF_LEFT_MOUSE_BUTTON); |
| 228 widget_->OnMouseEvent(&released_event); | 230 widget_->OnMouseEvent(&released_event); |
| 229 } | 231 } |
| 230 | 232 |
| 231 // We need widget to populate wrapper class. | 233 // We need widget to populate wrapper class. |
| 232 Widget* widget_; | 234 Widget* widget_; |
| 233 | 235 |
| 234 // |combobox_| will be allocated InitCombobox() and then owned by |widget_|. | 236 // |combobox_| will be allocated InitCombobox() and then owned by |widget_|. |
| 235 TestCombobox* combobox_; | 237 TestCombobox* combobox_; |
| 236 | 238 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 test_api.reset( | 531 test_api.reset( |
| 530 new test::MenuRunnerTestAPI(combobox_->dropdown_list_menu_runner_.get())); | 532 new test::MenuRunnerTestAPI(combobox_->dropdown_list_menu_runner_.get())); |
| 531 test_api->SetMenuRunnerHandler(menu_runner_handler.Pass()); | 533 test_api->SetMenuRunnerHandler(menu_runner_handler.Pass()); |
| 532 PerformClick(gfx::Point(combobox_->x() + 1, | 534 PerformClick(gfx::Point(combobox_->x() + 1, |
| 533 combobox_->y() + combobox_->height() / 2)); | 535 combobox_->y() + combobox_->height() / 2)); |
| 534 EXPECT_TRUE(listener.on_combobox_text_button_clicked_called()); | 536 EXPECT_TRUE(listener.on_combobox_text_button_clicked_called()); |
| 535 EXPECT_FALSE(test_menu_runner_handler->executed()); | 537 EXPECT_FALSE(test_menu_runner_handler->executed()); |
| 536 } | 538 } |
| 537 | 539 |
| 538 } // namespace views | 540 } // namespace views |
| OLD | NEW |