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

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

Issue 1673403002: Views - fix up layout of a couple dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: msw review Created 4 years, 10 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
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 confirm_label_ = new views::Label( 57 confirm_label_ = new views::Label(
58 l10n_util::GetStringUTF16(IDS_UNINSTALL_VERIFY)); 58 l10n_util::GetStringUTF16(IDS_UNINSTALL_VERIFY));
59 confirm_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 59 confirm_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
60 layout->AddView(confirm_label_); 60 layout->AddView(confirm_label_);
61 61
62 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); 62 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing);
63 63
64 // The "delete profile" check box. 64 // The "delete profile" check box.
65 ++column_set_id; 65 ++column_set_id;
66 column_set = layout->AddColumnSet(column_set_id); 66 column_set = layout->AddColumnSet(column_set_id);
67 column_set->AddPaddingColumn(0, views::kPanelHorizIndentation); 67 column_set->AddPaddingColumn(0, views::kCheckboxIndent);
68 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, 68 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
69 GridLayout::USE_PREF, 0, 0); 69 GridLayout::USE_PREF, 0, 0);
70 layout->StartRow(0, column_set_id); 70 layout->StartRow(0, column_set_id);
71 delete_profile_ = new views::Checkbox( 71 delete_profile_ = new views::Checkbox(
72 l10n_util::GetStringUTF16(IDS_UNINSTALL_DELETE_PROFILE)); 72 l10n_util::GetStringUTF16(IDS_UNINSTALL_DELETE_PROFILE));
73 layout->AddView(delete_profile_); 73 layout->AddView(delete_profile_);
74 74
75 // Set default browser combo box. If the default should not or cannot be 75 // Set default browser combo box. If the default should not or cannot be
76 // changed, widgets are not shown. We assume here that if Chrome cannot 76 // changed, widgets are not shown. We assume here that if Chrome cannot
77 // be set programatically as default, neither can any other browser (for 77 // be set programatically as default, neither can any other browser (for
78 // instance because the OS doesn't permit that). 78 // instance because the OS doesn't permit that).
79 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 79 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
80 if (dist->GetDefaultBrowserControlPolicy() != 80 if (dist->GetDefaultBrowserControlPolicy() !=
81 BrowserDistribution::DEFAULT_BROWSER_UNSUPPORTED && 81 BrowserDistribution::DEFAULT_BROWSER_UNSUPPORTED &&
82 ShellIntegration::GetDefaultBrowser() == ShellIntegration::IS_DEFAULT && 82 ShellIntegration::GetDefaultBrowser() == ShellIntegration::IS_DEFAULT &&
83 (ShellIntegration::CanSetAsDefaultBrowser() == 83 (ShellIntegration::CanSetAsDefaultBrowser() ==
84 ShellIntegration::SET_DEFAULT_NOT_ALLOWED || 84 ShellIntegration::SET_DEFAULT_NOT_ALLOWED ||
85 ShellIntegration::CanSetAsDefaultBrowser() == 85 ShellIntegration::CanSetAsDefaultBrowser() ==
86 ShellIntegration::SET_DEFAULT_UNATTENDED)) { 86 ShellIntegration::SET_DEFAULT_UNATTENDED)) {
87 browsers_.reset(new BrowsersMap()); 87 browsers_.reset(new BrowsersMap());
88 ShellUtil::GetRegisteredBrowsers(dist, browsers_.get()); 88 ShellUtil::GetRegisteredBrowsers(dist, browsers_.get());
89 if (!browsers_->empty()) { 89 if (!browsers_->empty()) {
90 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); 90 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
91 91
92 ++column_set_id; 92 ++column_set_id;
93 column_set = layout->AddColumnSet(column_set_id); 93 column_set = layout->AddColumnSet(column_set_id);
94 column_set->AddPaddingColumn(0, views::kPanelHorizIndentation); 94 column_set->AddPaddingColumn(0, views::kCheckboxIndent);
95 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, 95 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
96 GridLayout::USE_PREF, 0, 0); 96 GridLayout::USE_PREF, 0, 0);
97 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); 97 column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
98 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0, 98 column_set->AddColumn(GridLayout::LEADING, GridLayout::CENTER, 0,
99 GridLayout::USE_PREF, 0, 0); 99 GridLayout::USE_PREF, 0, 0);
100 layout->StartRow(0, column_set_id); 100 layout->StartRow(0, column_set_id);
101 change_default_browser_ = new views::Checkbox( 101 change_default_browser_ = new views::Checkbox(
102 l10n_util::GetStringUTF16(IDS_UNINSTALL_SET_DEFAULT_BROWSER)); 102 l10n_util::GetStringUTF16(IDS_UNINSTALL_SET_DEFAULT_BROWSER));
103 change_default_browser_->set_listener(this); 103 change_default_browser_->set_listener(this);
104 layout->AddView(change_default_browser_); 104 layout->AddView(change_default_browser_);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 base::RunLoop run_loop; 181 base::RunLoop run_loop;
182 UninstallView* view = new UninstallView(&result, 182 UninstallView* view = new UninstallView(&result,
183 run_loop.QuitClosure()); 183 run_loop.QuitClosure());
184 views::DialogDelegate::CreateDialogWidget(view, NULL, NULL)->Show(); 184 views::DialogDelegate::CreateDialogWidget(view, NULL, NULL)->Show();
185 run_loop.Run(); 185 run_loop.Run();
186 return result; 186 return result;
187 } 187 }
188 188
189 } // namespace chrome 189 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698