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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ++column_set_id; | 62 ++column_set_id; |
63 column_set = layout->AddColumnSet(column_set_id); | 63 column_set = layout->AddColumnSet(column_set_id); |
64 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 64 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); |
65 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, | 65 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, |
66 GridLayout::USE_PREF, 0, 0); | 66 GridLayout::USE_PREF, 0, 0); |
67 layout->StartRow(0, column_set_id); | 67 layout->StartRow(0, column_set_id); |
68 delete_profile_ = new views::Checkbox( | 68 delete_profile_ = new views::Checkbox( |
69 l10n_util::GetStringUTF16(IDS_UNINSTALL_DELETE_PROFILE)); | 69 l10n_util::GetStringUTF16(IDS_UNINSTALL_DELETE_PROFILE)); |
70 layout->AddView(delete_profile_); | 70 layout->AddView(delete_profile_); |
71 | 71 |
72 // Set default browser combo box | 72 // Set default browser combo box. If the default should not or cannot be |
| 73 // changed, widgets are not shown. We assume here that if Chrome cannot |
| 74 // be set programatically as default, neither can any other browser (for |
| 75 // instance because the OS doesn't permit that). |
73 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 76 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
74 if (dist->CanSetAsDefault() && | 77 if (dist->CanSetAsDefault() && |
75 ShellIntegration::IsDefaultBrowser()) { | 78 ShellIntegration::IsDefaultBrowser() && |
| 79 (ShellIntegration::CanSetAsDefaultBrowser() != |
| 80 ShellIntegration::SET_DEFAULT_INTERACTIVE)) { |
76 browsers_.reset(new BrowsersMap()); | 81 browsers_.reset(new BrowsersMap()); |
77 ShellUtil::GetRegisteredBrowsers(dist, browsers_.get()); | 82 ShellUtil::GetRegisteredBrowsers(dist, browsers_.get()); |
78 if (!browsers_->empty()) { | 83 if (!browsers_->empty()) { |
79 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 84 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
80 | 85 |
81 ++column_set_id; | 86 ++column_set_id; |
82 column_set = layout->AddColumnSet(column_set_id); | 87 column_set = layout->AddColumnSet(column_set_id); |
83 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 88 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); |
84 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, | 89 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, |
85 GridLayout::USE_PREF, 0, 0); | 90 GridLayout::USE_PREF, 0, 0); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 165 |
161 int ShowUninstallBrowserPrompt() { | 166 int ShowUninstallBrowserPrompt() { |
162 int result = content::RESULT_CODE_NORMAL_EXIT; | 167 int result = content::RESULT_CODE_NORMAL_EXIT; |
163 views::Widget::CreateWindow(new UninstallView(&result))->Show(); | 168 views::Widget::CreateWindow(new UninstallView(&result))->Show(); |
164 views::AcceleratorHandler accelerator_handler; | 169 views::AcceleratorHandler accelerator_handler; |
165 MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); | 170 MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); |
166 return result; | 171 return result; |
167 } | 172 } |
168 | 173 |
169 } // namespace browser | 174 } // namespace browser |
OLD | NEW |