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

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

Issue 1402543002: Don't use base::MessageLoop::{Quit,QuitClosure} in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698