| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 widget_->OnKeyEvent(&event); | 278 widget_->OnKeyEvent(&event); |
| 279 if (!event.handled() && focus_manager) | 279 if (!event.handled() && focus_manager) |
| 280 focus_manager->OnKeyEvent(event); | 280 focus_manager->OnKeyEvent(event); |
| 281 } | 281 } |
| 282 | 282 |
| 283 View* GetFocusedView() { | 283 View* GetFocusedView() { |
| 284 return widget_->GetFocusManager()->GetFocusedView(); | 284 return widget_->GetFocusManager()->GetFocusedView(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void PerformClick(const gfx::Point& point) { | 287 void PerformClick(const gfx::Point& point) { |
| 288 ui::MouseEvent pressed_event = ui::MouseEvent( | 288 ui::MouseEvent pressed_event = |
| 289 ui::ET_MOUSE_PRESSED, point, point, ui::EventTimeForNow(), | 289 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::PointF(point), |
| 290 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); | 290 gfx::PointF(point), ui::EventTimeForNow(), |
| 291 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); |
| 291 widget_->OnMouseEvent(&pressed_event); | 292 widget_->OnMouseEvent(&pressed_event); |
| 292 ui::MouseEvent released_event = ui::MouseEvent( | 293 ui::MouseEvent released_event = |
| 293 ui::ET_MOUSE_RELEASED, point, point, ui::EventTimeForNow(), | 294 ui::MouseEvent(ui::ET_MOUSE_RELEASED, gfx::PointF(point), |
| 294 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); | 295 gfx::PointF(point), ui::EventTimeForNow(), |
| 296 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); |
| 295 widget_->OnMouseEvent(&released_event); | 297 widget_->OnMouseEvent(&released_event); |
| 296 } | 298 } |
| 297 | 299 |
| 298 // We need widget to populate wrapper class. | 300 // We need widget to populate wrapper class. |
| 299 Widget* widget_; | 301 Widget* widget_; |
| 300 | 302 |
| 301 // |combobox_| will be allocated InitCombobox() and then owned by |widget_|. | 303 // |combobox_| will be allocated InitCombobox() and then owned by |widget_|. |
| 302 TestCombobox* combobox_; | 304 TestCombobox* combobox_; |
| 303 scoped_ptr<ComboboxTestApi> test_api_; | 305 scoped_ptr<ComboboxTestApi> test_api_; |
| 304 | 306 |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 EXPECT_EQ(ASCIIToUTF16("JELLY"), menu_model->GetLabelAt(1)); | 801 EXPECT_EQ(ASCIIToUTF16("JELLY"), menu_model->GetLabelAt(1)); |
| 800 | 802 |
| 801 // Check that with STYLE_ACTION, the first item (only) is not shown. | 803 // Check that with STYLE_ACTION, the first item (only) is not shown. |
| 802 EXPECT_TRUE(menu_model->IsVisibleAt(0)); | 804 EXPECT_TRUE(menu_model->IsVisibleAt(0)); |
| 803 combobox_->SetStyle(Combobox::STYLE_ACTION); | 805 combobox_->SetStyle(Combobox::STYLE_ACTION); |
| 804 EXPECT_FALSE(menu_model->IsVisibleAt(0)); | 806 EXPECT_FALSE(menu_model->IsVisibleAt(0)); |
| 805 EXPECT_TRUE(menu_model->IsVisibleAt(1)); | 807 EXPECT_TRUE(menu_model->IsVisibleAt(1)); |
| 806 } | 808 } |
| 807 | 809 |
| 808 } // namespace views | 810 } // namespace views |
| OLD | NEW |