| 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 "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // Disable the browsers combobox if the user unchecks the checkbox. | 142 // Disable the browsers combobox if the user unchecks the checkbox. |
| 143 DCHECK(browsers_combo_); | 143 DCHECK(browsers_combo_); |
| 144 browsers_combo_->SetEnabled(change_default_browser_->checked()); | 144 browsers_combo_->SetEnabled(change_default_browser_->checked()); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 string16 UninstallView::GetWindowTitle() const { | 148 string16 UninstallView::GetWindowTitle() const { |
| 149 return l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME); | 149 return l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME); |
| 150 } | 150 } |
| 151 | 151 |
| 152 views::View* UninstallView::GetContentsView() { | |
| 153 return this; | |
| 154 } | |
| 155 | |
| 156 int UninstallView::GetItemCount() const { | 152 int UninstallView::GetItemCount() const { |
| 157 DCHECK(!browsers_->empty()); | 153 DCHECK(!browsers_->empty()); |
| 158 return browsers_->size(); | 154 return browsers_->size(); |
| 159 } | 155 } |
| 160 | 156 |
| 161 string16 UninstallView::GetItemAt(int index) { | 157 string16 UninstallView::GetItemAt(int index) { |
| 162 DCHECK_LT(index, static_cast<int>(browsers_->size())); | 158 DCHECK_LT(index, static_cast<int>(browsers_->size())); |
| 163 BrowsersMap::const_iterator i = browsers_->begin(); | 159 BrowsersMap::const_iterator i = browsers_->begin(); |
| 164 std::advance(i, index); | 160 std::advance(i, index); |
| 165 return i->first; | 161 return i->first; |
| 166 } | 162 } |
| 167 | 163 |
| 168 namespace chrome { | 164 namespace chrome { |
| 169 | 165 |
| 170 int ShowUninstallBrowserPrompt(bool show_delete_profile) { | 166 int ShowUninstallBrowserPrompt(bool show_delete_profile) { |
| 171 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 167 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
| 172 int result = content::RESULT_CODE_NORMAL_EXIT; | 168 int result = content::RESULT_CODE_NORMAL_EXIT; |
| 173 views::AcceleratorHandler accelerator_handler; | 169 views::AcceleratorHandler accelerator_handler; |
| 174 base::RunLoop run_loop(&accelerator_handler); | 170 base::RunLoop run_loop(&accelerator_handler); |
| 175 UninstallView* view = new UninstallView(&result, | 171 UninstallView* view = new UninstallView(&result, |
| 176 run_loop.QuitClosure(), | 172 run_loop.QuitClosure(), |
| 177 show_delete_profile); | 173 show_delete_profile); |
| 178 views::Widget::CreateWindow(view)->Show(); | 174 views::Widget::CreateWindow(view)->Show(); |
| 179 run_loop.Run(); | 175 run_loop.Run(); |
| 180 return result; | 176 return result; |
| 181 } | 177 } |
| 182 | 178 |
| 183 } // namespace chrome | 179 } // namespace chrome |
| OLD | NEW |