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/string16.h" | 9 #include "base/string16.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); | 97 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); |
98 } | 98 } |
99 | 99 |
100 bool UninstallView::Accept() { | 100 bool UninstallView::Accept() { |
101 user_selection_ = content::RESULT_CODE_NORMAL_EXIT; | 101 user_selection_ = content::RESULT_CODE_NORMAL_EXIT; |
102 if (delete_profile_->checked()) | 102 if (delete_profile_->checked()) |
103 user_selection_ = chrome::RESULT_CODE_UNINSTALL_DELETE_PROFILE; | 103 user_selection_ = chrome::RESULT_CODE_UNINSTALL_DELETE_PROFILE; |
104 if (change_default_browser_ && change_default_browser_->checked()) { | 104 if (change_default_browser_ && change_default_browser_->checked()) { |
105 int index = browsers_combo_->selected_item(); | |
106 BrowsersMap::const_iterator it = browsers_->begin(); | 105 BrowsersMap::const_iterator it = browsers_->begin(); |
107 std::advance(it, index); | 106 std::advance(it, browsers_combo_->selected_index()); |
108 base::LaunchOptions options; | 107 base::LaunchOptions options; |
109 options.start_hidden = true; | 108 options.start_hidden = true; |
110 base::LaunchProcess((*it).second, options, NULL); | 109 base::LaunchProcess((*it).second, options, NULL); |
111 } | 110 } |
112 return true; | 111 return true; |
113 } | 112 } |
114 | 113 |
115 bool UninstallView::Cancel() { | 114 bool UninstallView::Cancel() { |
116 user_selection_ = chrome::RESULT_CODE_UNINSTALL_USER_CANCEL; | 115 user_selection_ = chrome::RESULT_CODE_UNINSTALL_USER_CANCEL; |
117 return true; | 116 return true; |
(...skipping 28 matching lines...) Expand all Loading... |
146 DCHECK(!browsers_->empty()); | 145 DCHECK(!browsers_->empty()); |
147 return browsers_->size(); | 146 return browsers_->size(); |
148 } | 147 } |
149 | 148 |
150 string16 UninstallView::GetItemAt(int index) { | 149 string16 UninstallView::GetItemAt(int index) { |
151 DCHECK_LT(index, static_cast<int>(browsers_->size())); | 150 DCHECK_LT(index, static_cast<int>(browsers_->size())); |
152 BrowsersMap::const_iterator it = browsers_->begin(); | 151 BrowsersMap::const_iterator it = browsers_->begin(); |
153 std::advance(it, index); | 152 std::advance(it, index); |
154 return WideToUTF16Hack((*it).first); | 153 return WideToUTF16Hack((*it).first); |
155 } | 154 } |
OLD | NEW |