Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: ui/views/examples/examples_window.cc

Issue 9838092: ui/base/models: Make ComboboxModel::GetItemCount() a constant function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_rel and reland Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/examples/example_combobox_model.cc ('k') | ui/views/focus/focus_traversal_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/examples/example_combobox_model.cc ('k') | ui/views/focus/focus_traversal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698