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 bool CanResize() const override { return true; } | 177 bool CanResize() const override { return true; } |
178 bool CanMaximize() const override { return true; } | 178 bool CanMaximize() const override { return true; } |
179 bool CanMinimize() const override { return true; } | 179 bool CanMinimize() const override { return true; } |
180 base::string16 GetWindowTitle() const override { | 180 base::string16 GetWindowTitle() const override { |
181 return base::ASCIIToUTF16("Views Examples"); | 181 return base::ASCIIToUTF16("Views Examples"); |
182 } | 182 } |
183 View* GetContentsView() override { return this; } | 183 View* GetContentsView() override { return this; } |
184 void WindowClosing() override { | 184 void WindowClosing() override { |
185 instance_ = NULL; | 185 instance_ = NULL; |
186 if (operation_ == QUIT_ON_CLOSE) | 186 if (operation_ == QUIT_ON_CLOSE) |
187 base::MessageLoopForUI::current()->Quit(); | 187 base::MessageLoopForUI::current()->QuitWhenIdle(); |
188 } | 188 } |
189 | 189 |
190 // ComboboxListener: | 190 // ComboboxListener: |
191 void OnPerformAction(Combobox* combobox) override { | 191 void OnPerformAction(Combobox* combobox) override { |
192 DCHECK_EQ(combobox, combobox_); | 192 DCHECK_EQ(combobox, combobox_); |
193 DCHECK(combobox->selected_index() < combobox_model_.GetItemCount()); | 193 DCHECK(combobox->selected_index() < combobox_model_.GetItemCount()); |
194 example_shown_->RemoveAllChildViews(false); | 194 example_shown_->RemoveAllChildViews(false); |
195 example_shown_->AddChildView(combobox_model_.GetItemViewAt( | 195 example_shown_->AddChildView(combobox_model_.GetItemViewAt( |
196 combobox->selected_index())); | 196 combobox->selected_index())); |
197 example_shown_->RequestFocus(); | 197 example_shown_->RequestFocus(); |
(...skipping 30 matching lines...) Expand all Loading... |
228 widget->Show(); | 228 widget->Show(); |
229 } | 229 } |
230 } | 230 } |
231 | 231 |
232 void LogStatus(const std::string& string) { | 232 void LogStatus(const std::string& string) { |
233 ExamplesWindowContents::instance()->SetStatus(string); | 233 ExamplesWindowContents::instance()->SetStatus(string); |
234 } | 234 } |
235 | 235 |
236 } // namespace examples | 236 } // namespace examples |
237 } // namespace views | 237 } // namespace views |
OLD | NEW |