| OLD | NEW |
| 1 // Copyright (c) 2009 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 "app/combobox_model.h" | 7 #include "app/combobox_model.h" |
| 8 #include "base/keyboard_codes.h" | 8 #include "base/keyboard_codes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string16.h" |
| 10 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 11 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 12 #include "gfx/rect.h" | 13 #include "gfx/rect.h" |
| 13 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
| 14 #include "views/background.h" | 15 #include "views/background.h" |
| 15 #include "views/border.h" | 16 #include "views/border.h" |
| 16 #include "views/controls/button/checkbox.h" | 17 #include "views/controls/button/checkbox.h" |
| 17 #include "views/controls/button/native_button.h" | 18 #include "views/controls/button/native_button.h" |
| 18 #include "views/controls/button/radio_button.h" | 19 #include "views/controls/button/radio_button.h" |
| 19 #include "views/controls/combobox/combobox.h" | 20 #include "views/controls/combobox/combobox.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 View* child_; | 316 View* child_; |
| 316 Widget* widget_; | 317 Widget* widget_; |
| 317 | 318 |
| 318 DISALLOW_COPY_AND_ASSIGN(BorderView); | 319 DISALLOW_COPY_AND_ASSIGN(BorderView); |
| 319 }; | 320 }; |
| 320 | 321 |
| 321 class DummyComboboxModel : public ComboboxModel { | 322 class DummyComboboxModel : public ComboboxModel { |
| 322 public: | 323 public: |
| 323 virtual int GetItemCount() { return 10; } | 324 virtual int GetItemCount() { return 10; } |
| 324 | 325 |
| 325 virtual std::wstring GetItemAt(int index) { | 326 virtual string16 GetItemAt(int index) { |
| 326 return L"Item " + UTF16ToWideHack(base::IntToString16(index)); | 327 return ASCIIToUTF16("Item ") + base::IntToString16(index); |
| 327 } | 328 } |
| 328 }; | 329 }; |
| 329 | 330 |
| 330 // A View that can act as a pane. | 331 // A View that can act as a pane. |
| 331 class PaneView : public View, public FocusTraversable { | 332 class PaneView : public View, public FocusTraversable { |
| 332 public: | 333 public: |
| 333 PaneView() : focus_search_(NULL) {} | 334 PaneView() : focus_search_(NULL) {} |
| 334 | 335 |
| 335 // If this method is called, this view will use GetPaneFocusTraversable to | 336 // If this method is called, this view will use GetPaneFocusTraversable to |
| 336 // have this provided FocusSearch used instead of the default one, allowing | 337 // have this provided FocusSearch used instead of the default one, allowing |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 | 901 |
| 901 class TestCombobox : public Combobox, public ComboboxModel { | 902 class TestCombobox : public Combobox, public ComboboxModel { |
| 902 public: | 903 public: |
| 903 TestCombobox() : Combobox(this) { } | 904 TestCombobox() : Combobox(this) { } |
| 904 virtual gfx::NativeView TestGetNativeControlView() { | 905 virtual gfx::NativeView TestGetNativeControlView() { |
| 905 return native_wrapper_->GetTestingHandle(); | 906 return native_wrapper_->GetTestingHandle(); |
| 906 } | 907 } |
| 907 virtual int GetItemCount() { | 908 virtual int GetItemCount() { |
| 908 return 10; | 909 return 10; |
| 909 } | 910 } |
| 910 virtual std::wstring GetItemAt(int index) { | 911 virtual string16 GetItemAt(int index) { |
| 911 return L"Hello combo"; | 912 return ASCIIToUTF16("Hello combo"); |
| 912 } | 913 } |
| 913 }; | 914 }; |
| 914 | 915 |
| 915 class TestTabbedPane : public TabbedPane { | 916 class TestTabbedPane : public TabbedPane { |
| 916 public: | 917 public: |
| 917 TestTabbedPane() { } | 918 TestTabbedPane() { } |
| 918 virtual gfx::NativeView TestGetNativeControlView() { | 919 virtual gfx::NativeView TestGetNativeControlView() { |
| 919 return native_tabbed_pane_->GetTestingHandle(); | 920 return native_tabbed_pane_->GetTestingHandle(); |
| 920 } | 921 } |
| 921 }; | 922 }; |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 // Focus manager should be the last one to destruct. | 1719 // Focus manager should be the last one to destruct. |
| 1719 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); | 1720 ASSERT_STREQ("FocusManagerDtorTracked", dtor_tracker_[2].c_str()); |
| 1720 | 1721 |
| 1721 // Clear window_ so that we don't try to close it again. | 1722 // Clear window_ so that we don't try to close it again. |
| 1722 window_ = NULL; | 1723 window_ = NULL; |
| 1723 } | 1724 } |
| 1724 | 1725 |
| 1725 #endif // defined(OS_CHROMEOS) | 1726 #endif // defined(OS_CHROMEOS) |
| 1726 | 1727 |
| 1727 } // namespace views | 1728 } // namespace views |
| OLD | NEW |