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/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 private: | 130 private: |
131 std::vector<std::string>* values_; | 131 std::vector<std::string>* values_; |
132 int default_index_ = 0; | 132 int default_index_ = 0; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(VectorComboboxModel); | 134 DISALLOW_COPY_AND_ASSIGN(VectorComboboxModel); |
135 }; | 135 }; |
136 | 136 |
137 class EvilListener : public ComboboxListener { | 137 class EvilListener : public ComboboxListener { |
138 public: | 138 public: |
139 EvilListener() : deleted_(false) {} | 139 EvilListener() : deleted_(false) {} |
140 ~EvilListener() override{}; | 140 ~EvilListener() override {} |
141 | 141 |
142 // ComboboxListener: | 142 // ComboboxListener: |
143 void OnPerformAction(Combobox* combobox) override { | 143 void OnPerformAction(Combobox* combobox) override { |
144 delete combobox; | 144 delete combobox; |
145 deleted_ = true; | 145 deleted_ = true; |
146 } | 146 } |
147 | 147 |
148 bool deleted() const { return deleted_; } | 148 bool deleted() const { return deleted_; } |
149 | 149 |
150 private: | 150 private: |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(0)); | 916 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(0)); |
917 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(1)); | 917 EXPECT_EQ(ui::MenuModel::TYPE_COMMAND, menu_model->GetTypeAt(1)); |
918 | 918 |
919 EXPECT_EQ(ASCIIToUTF16("PEANUT BUTTER"), menu_model->GetLabelAt(0)); | 919 EXPECT_EQ(ASCIIToUTF16("PEANUT BUTTER"), menu_model->GetLabelAt(0)); |
920 EXPECT_EQ(ASCIIToUTF16("JELLY"), menu_model->GetLabelAt(1)); | 920 EXPECT_EQ(ASCIIToUTF16("JELLY"), menu_model->GetLabelAt(1)); |
921 EXPECT_FALSE(menu_model->IsVisibleAt(0)); | 921 EXPECT_FALSE(menu_model->IsVisibleAt(0)); |
922 EXPECT_TRUE(menu_model->IsVisibleAt(1)); | 922 EXPECT_TRUE(menu_model->IsVisibleAt(1)); |
923 } | 923 } |
924 | 924 |
925 } // namespace views | 925 } // namespace views |
OLD | NEW |