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

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

Issue 141523005: Combobox: Rename styles to STYLE_NORMAL and STYLE_ACTION and modify behaviors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix for Windows Created 6 years, 10 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
« no previous file with comments | « ui/views/examples/combobox_example.cc ('k') | ui/views/examples/text_example.h » ('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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return base::ASCIIToUTF16("Views Examples"); 177 return base::ASCIIToUTF16("Views Examples");
178 } 178 }
179 virtual View* GetContentsView() OVERRIDE { return this; } 179 virtual View* GetContentsView() OVERRIDE { return this; }
180 virtual void WindowClosing() OVERRIDE { 180 virtual void WindowClosing() OVERRIDE {
181 instance_ = NULL; 181 instance_ = NULL;
182 if (operation_ == QUIT_ON_CLOSE) 182 if (operation_ == QUIT_ON_CLOSE)
183 base::MessageLoopForUI::current()->Quit(); 183 base::MessageLoopForUI::current()->Quit();
184 } 184 }
185 185
186 // ComboboxListener: 186 // ComboboxListener:
187 virtual void OnSelectedIndexChanged(Combobox* combobox) OVERRIDE { 187 virtual void OnPerformAction(Combobox* combobox) OVERRIDE {
188 DCHECK_EQ(combobox, combobox_); 188 DCHECK_EQ(combobox, combobox_);
189 DCHECK(combobox->selected_index() < combobox_model_.GetItemCount()); 189 DCHECK(combobox->selected_index() < combobox_model_.GetItemCount());
190 example_shown_->RemoveAllChildViews(false); 190 example_shown_->RemoveAllChildViews(false);
191 example_shown_->AddChildView(combobox_model_.GetItemViewAt( 191 example_shown_->AddChildView(combobox_model_.GetItemViewAt(
192 combobox->selected_index())); 192 combobox->selected_index()));
193 example_shown_->RequestFocus(); 193 example_shown_->RequestFocus();
194 SetStatus(std::string()); 194 SetStatus(std::string());
195 Layout(); 195 Layout();
196 } 196 }
197 197
(...skipping 27 matching lines...) Expand all
225 widget->Show(); 225 widget->Show();
226 } 226 }
227 } 227 }
228 228
229 void LogStatus(const std::string& string) { 229 void LogStatus(const std::string& string) {
230 ExamplesWindowContents::instance()->SetStatus(string); 230 ExamplesWindowContents::instance()->SetStatus(string);
231 } 231 }
232 232
233 } // namespace examples 233 } // namespace examples
234 } // namespace views 234 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/combobox_example.cc ('k') | ui/views/examples/text_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698