| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/examples/examples_window.h" | 5 #include "ui/views/examples/examples_window.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/icu_util.h" | 9 #include "base/i18n/icu_util.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 namespace views { | 47 namespace views { |
| 48 namespace examples { | 48 namespace examples { |
| 49 | 49 |
| 50 // Model for the examples that are being added via AddExample(). | 50 // Model for the examples that are being added via AddExample(). |
| 51 class ComboboxModelExampleList : public ui::ComboboxModel { | 51 class ComboboxModelExampleList : public ui::ComboboxModel { |
| 52 public: | 52 public: |
| 53 ComboboxModelExampleList() {} | 53 ComboboxModelExampleList() {} |
| 54 virtual ~ComboboxModelExampleList() {} | 54 virtual ~ComboboxModelExampleList() {} |
| 55 | 55 |
| 56 // Overridden from ui::ComboboxModel: | 56 // Overridden from ui::ComboboxModel: |
| 57 virtual int GetItemCount() OVERRIDE { return example_list_.size(); } | 57 virtual int GetItemCount() const OVERRIDE { return example_list_.size(); } |
| 58 virtual string16 GetItemAt(int index) OVERRIDE { | 58 virtual string16 GetItemAt(int index) OVERRIDE { |
| 59 return UTF8ToUTF16(example_list_[index]->example_title()); | 59 return UTF8ToUTF16(example_list_[index]->example_title()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 View* GetItemViewAt(int index) { | 62 View* GetItemViewAt(int index) { |
| 63 return example_list_[index]->example_view(); | 63 return example_list_[index]->example_view(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void AddExample(ExampleBase* example) { | 66 void AddExample(ExampleBase* example) { |
| 67 example_list_.push_back(example); | 67 example_list_.push_back(example); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 gfx::Rect(0, 0, 850, 300))->Show(); | 203 gfx::Rect(0, 0, 850, 300))->Show(); |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 void LogStatus(const std::string& string) { | 207 void LogStatus(const std::string& string) { |
| 208 ExamplesWindowContents::instance()->SetStatus(string); | 208 ExamplesWindowContents::instance()->SetStatus(string); |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace examples | 211 } // namespace examples |
| 212 } // namespace views | 212 } // namespace views |
| OLD | NEW |