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

Side by Side Diff: chrome/browser/ui/views/uninstall_view.cc

Issue 141683005: Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 years, 11 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
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 "chrome/browser/ui/views/uninstall_view.h" 5 #include "chrome/browser/ui/views/uninstall_view.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/process/launch.h" 8 #include "base/process/launch.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 base::string16 UninstallView::GetItemAt(int index) { 162 base::string16 UninstallView::GetItemAt(int index) {
163 DCHECK_LT(index, static_cast<int>(browsers_->size())); 163 DCHECK_LT(index, static_cast<int>(browsers_->size()));
164 BrowsersMap::const_iterator i = browsers_->begin(); 164 BrowsersMap::const_iterator i = browsers_->begin();
165 std::advance(i, index); 165 std::advance(i, index);
166 return i->first; 166 return i->first;
167 } 167 }
168 168
169 namespace chrome { 169 namespace chrome {
170 170
171 int ShowUninstallBrowserPrompt(bool show_delete_profile) { 171 int ShowUninstallBrowserPrompt(bool show_delete_profile) {
172 DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); 172 DCHECK(base::MessageLoopForUI::IsCurrent());
173 int result = content::RESULT_CODE_NORMAL_EXIT; 173 int result = content::RESULT_CODE_NORMAL_EXIT;
174 views::AcceleratorHandler accelerator_handler; 174 views::AcceleratorHandler accelerator_handler;
175 175
176 // Take a reference on g_browser_process while showing the dialog. This is 176 // Take a reference on g_browser_process while showing the dialog. This is
177 // done because the dialog uses the views framework which may increment 177 // done because the dialog uses the views framework which may increment
178 // and decrement the module ref count during the course of displaying UI and 178 // and decrement the module ref count during the course of displaying UI and
179 // this code can be called while the module refcount is still at 0. 179 // this code can be called while the module refcount is still at 0.
180 // Note that this reference is never released, as this code is shown on a path 180 // Note that this reference is never released, as this code is shown on a path
181 // that immediately exits Chrome anyway. 181 // that immediately exits Chrome anyway.
182 // See http://crbug.com/241366 for details. 182 // See http://crbug.com/241366 for details.
183 g_browser_process->AddRefModule(); 183 g_browser_process->AddRefModule();
184 184
185 base::RunLoop run_loop(&accelerator_handler); 185 base::RunLoop run_loop(&accelerator_handler);
186 UninstallView* view = new UninstallView(&result, 186 UninstallView* view = new UninstallView(&result,
187 run_loop.QuitClosure(), 187 run_loop.QuitClosure(),
188 show_delete_profile); 188 show_delete_profile);
189 views::DialogDelegate::CreateDialogWidget(view, NULL, NULL)->Show(); 189 views::DialogDelegate::CreateDialogWidget(view, NULL, NULL)->Show();
190 run_loop.Run(); 190 run_loop.Run();
191 return result; 191 return result;
192 } 192 }
193 193
194 } // namespace chrome 194 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/protocol_dialog_gtk.cc ('k') | chrome/browser/ui/views/user_data_dir_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698