| 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 "chrome/browser/ui/views/uninstall_view.h" | 5 #include "chrome/browser/ui/views/uninstall_view.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 return browsers_->size(); | 157 return browsers_->size(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 string16 UninstallView::GetItemAt(int index) { | 160 string16 UninstallView::GetItemAt(int index) { |
| 161 DCHECK_LT(index, static_cast<int>(browsers_->size())); | 161 DCHECK_LT(index, static_cast<int>(browsers_->size())); |
| 162 BrowsersMap::const_iterator i = browsers_->begin(); | 162 BrowsersMap::const_iterator i = browsers_->begin(); |
| 163 std::advance(i, index); | 163 std::advance(i, index); |
| 164 return WideToUTF16Hack(i->first); | 164 return WideToUTF16Hack(i->first); |
| 165 } | 165 } |
| 166 | 166 |
| 167 namespace browser { | 167 namespace chrome { |
| 168 | 168 |
| 169 int ShowUninstallBrowserPrompt() { | 169 int ShowUninstallBrowserPrompt() { |
| 170 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 170 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 171 int result = content::RESULT_CODE_NORMAL_EXIT; | 171 int result = content::RESULT_CODE_NORMAL_EXIT; |
| 172 views::AcceleratorHandler accelerator_handler; | 172 views::AcceleratorHandler accelerator_handler; |
| 173 base::RunLoop run_loop(&accelerator_handler); | 173 base::RunLoop run_loop(&accelerator_handler); |
| 174 UninstallView* view = new UninstallView(&result, run_loop.QuitClosure()); | 174 UninstallView* view = new UninstallView(&result, run_loop.QuitClosure()); |
| 175 views::Widget::CreateWindow(view)->Show(); | 175 views::Widget::CreateWindow(view)->Show(); |
| 176 run_loop.Run(); | 176 run_loop.Run(); |
| 177 return result; | 177 return result; |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace browser | 180 } // namespace chrome |
| OLD | NEW |