| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |