| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); | 1441 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 1442 EXPECT_EQ(target.accelerator_count(), 1); | 1442 EXPECT_EQ(target.accelerator_count(), 1); |
| 1443 } | 1443 } |
| 1444 | 1444 |
| 1445 class MessageTrackingView : public View { | 1445 class MessageTrackingView : public View { |
| 1446 public: | 1446 public: |
| 1447 MessageTrackingView() : accelerator_pressed_(false) { | 1447 MessageTrackingView() : accelerator_pressed_(false) { |
| 1448 } | 1448 } |
| 1449 | 1449 |
| 1450 virtual bool OnKeyPressed(const KeyEvent& e) { | 1450 virtual bool OnKeyPressed(const KeyEvent& e) { |
| 1451 keys_pressed_.push_back(e.GetKeyCode()); | 1451 keys_pressed_.push_back(e.key_code()); |
| 1452 return true; | 1452 return true; |
| 1453 } | 1453 } |
| 1454 | 1454 |
| 1455 virtual bool OnKeyReleased(const KeyEvent& e) { | 1455 virtual bool OnKeyReleased(const KeyEvent& e) { |
| 1456 keys_released_.push_back(e.GetKeyCode()); | 1456 keys_released_.push_back(e.key_code()); |
| 1457 return true; | 1457 return true; |
| 1458 } | 1458 } |
| 1459 | 1459 |
| 1460 virtual bool AcceleratorPressed(const Accelerator& accelerator) { | 1460 virtual bool AcceleratorPressed(const Accelerator& accelerator) { |
| 1461 accelerator_pressed_ = true; | 1461 accelerator_pressed_ = true; |
| 1462 return true; | 1462 return true; |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 void Reset() { | 1465 void Reset() { |
| 1466 accelerator_pressed_ = false; | 1466 accelerator_pressed_ = false; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 // Focus manager should be the last one to destruct. | 1721 // Focus manager should be the last one to destruct. |
| 1722 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); | 1722 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); |
| 1723 | 1723 |
| 1724 // Clear window_ so that we don't try to close it again. | 1724 // Clear window_ so that we don't try to close it again. |
| 1725 window_ = NULL; | 1725 window_ = NULL; |
| 1726 } | 1726 } |
| 1727 | 1727 |
| 1728 #endif // defined(OS_CHROMEOS) | 1728 #endif // defined(OS_CHROMEOS) |
| 1729 | 1729 |
| 1730 } // namespace views | 1730 } // namespace views |
| OLD | NEW |