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/first_run/try_chrome_dialog_view.h" | 5 #include "chrome/browser/ui/views/try_chrome_dialog_view.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "chrome/browser/process_singleton.h" | 14 #include "chrome/browser/process_singleton.h" |
15 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | |
15 #include "chrome/grit/chromium_strings.h" | 16 #include "chrome/grit/chromium_strings.h" |
16 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
17 #include "chrome/grit/theme_resources.h" | 18 #include "chrome/grit/theme_resources.h" |
18 #include "chrome/install_static/install_util.h" | 19 #include "chrome/install_static/install_util.h" |
19 #include "chrome/installer/util/user_experiment.h" | 20 #include "chrome/installer/util/user_experiment.h" |
20 #include "components/strings/grit/components_strings.h" | 21 #include "components/strings/grit/components_strings.h" |
21 #include "ui/aura/window.h" | 22 #include "ui/aura/window.h" |
22 #include "ui/aura/window_tree_host.h" | 23 #include "ui/aura/window_tree_host.h" |
23 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
24 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/gfx/image/image.h" | 26 #include "ui/gfx/image/image.h" |
26 #include "ui/resources/grit/ui_resources.h" | 27 #include "ui/resources/grit/ui_resources.h" |
27 #include "ui/views/background.h" | 28 #include "ui/views/background.h" |
28 #include "ui/views/controls/button/checkbox.h" | 29 #include "ui/views/controls/button/checkbox.h" |
29 #include "ui/views/controls/button/image_button.h" | 30 #include "ui/views/controls/button/image_button.h" |
30 #include "ui/views/controls/button/md_text_button.h" | 31 #include "ui/views/controls/button/md_text_button.h" |
31 #include "ui/views/controls/button/radio_button.h" | 32 #include "ui/views/controls/button/radio_button.h" |
32 #include "ui/views/controls/image_view.h" | 33 #include "ui/views/controls/image_view.h" |
33 #include "ui/views/controls/link.h" | 34 #include "ui/views/controls/link.h" |
34 #include "ui/views/controls/separator.h" | 35 #include "ui/views/controls/separator.h" |
35 #include "ui/views/layout/grid_layout.h" | 36 #include "ui/views/layout/grid_layout.h" |
36 #include "ui/views/layout/layout_constants.h" | |
37 #include "ui/views/layout/layout_provider.h" | 37 #include "ui/views/layout/layout_provider.h" |
38 #include "ui/views/widget/widget.h" | 38 #include "ui/views/widget/widget.h" |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 const wchar_t kHelpCenterUrl[] = | 42 const wchar_t kHelpCenterUrl[] = |
43 L"https://support.google.com/chrome/answer/150752"; | 43 L"https://support.google.com/chrome/answer/150752"; |
44 | 44 |
45 enum ButtonTags { | 45 enum ButtonTags { |
46 BT_NONE, | 46 BT_NONE, |
(...skipping 20 matching lines...) Expand all Loading... | |
67 return dialog.ShowModal(listener); | 67 return dialog.ShowModal(listener); |
68 } | 68 } |
69 | 69 |
70 TryChromeDialogView::TryChromeDialogView(size_t flavor) | 70 TryChromeDialogView::TryChromeDialogView(size_t flavor) |
71 : flavor_(flavor), | 71 : flavor_(flavor), |
72 popup_(NULL), | 72 popup_(NULL), |
73 try_chrome_(NULL), | 73 try_chrome_(NULL), |
74 kill_chrome_(NULL), | 74 kill_chrome_(NULL), |
75 dont_try_chrome_(NULL), | 75 dont_try_chrome_(NULL), |
76 make_default_(NULL), | 76 make_default_(NULL), |
77 result_(COUNT) { | 77 result_(COUNT) {} |
78 } | |
79 | 78 |
80 TryChromeDialogView::~TryChromeDialogView() { | 79 TryChromeDialogView::~TryChromeDialogView() {} |
81 } | |
82 | 80 |
83 TryChromeDialogView::Result TryChromeDialogView::ShowModal( | 81 TryChromeDialogView::Result TryChromeDialogView::ShowModal( |
84 const ActiveModalDialogListener& listener) { | 82 const ActiveModalDialogListener& listener) { |
85 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 83 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
86 | 84 |
87 views::ImageView* icon = new views::ImageView(); | 85 views::ImageView* icon = new views::ImageView(); |
88 icon->SetImage(rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_32).ToImageSkia()); | 86 icon->SetImage(rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_32).ToImageSkia()); |
89 gfx::Size icon_size = icon->GetPreferredSize(); | 87 gfx::Size icon_size = icon->GetPreferredSize(); |
90 | 88 |
91 // An approximate window size. After Layout() we'll get better bounds. | 89 // An approximate window size. After Layout() we'll get better bounds. |
92 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 90 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
93 params.activatable = views::Widget::InitParams::ACTIVATABLE_YES; | 91 params.activatable = views::Widget::InitParams::ACTIVATABLE_YES; |
94 params.bounds = gfx::Rect(310, 200); | 92 params.bounds = gfx::Rect(310, 200); |
95 popup_ = new views::Widget; | 93 popup_ = new views::Widget; |
96 popup_->Init(params); | 94 popup_->Init(params); |
97 | 95 |
98 views::View* root_view = popup_->GetRootView(); | 96 views::View* root_view = popup_->GetRootView(); |
99 // The window color is a tiny bit off-white. | 97 // The window color is a tiny bit off-white. |
100 root_view->set_background( | 98 root_view->set_background( |
101 views::Background::CreateSolidBackground(0xfc, 0xfc, 0xfc)); | 99 views::Background::CreateSolidBackground(0xfc, 0xfc, 0xfc)); |
102 | 100 |
103 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); | 101 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); |
104 views::ColumnSet* columns; | 102 views::ColumnSet* columns; |
105 | 103 |
104 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); | |
105 const int label_spacing = | |
106 provider->GetDistanceMetric(DISTANCE_RELATED_LABEL_HORIZONTAL); | |
107 const int unrelated_space_horiz = | |
108 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL); | |
109 const int unrelated_space_vert = | |
110 provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL); | |
111 const int button_spacing_horiz = | |
112 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL); | |
113 | |
106 // First row: [icon][pad][text][pad][button]. | 114 // First row: [icon][pad][text][pad][button]. |
107 columns = layout->AddColumnSet(0); | 115 columns = layout->AddColumnSet(0); |
108 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, | 116 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0, |
109 views::GridLayout::FIXED, icon_size.width(), | 117 views::GridLayout::FIXED, icon_size.width(), |
110 icon_size.height()); | 118 icon_size.height()); |
111 columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 119 columns->AddPaddingColumn(0, label_spacing); |
112 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 120 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
113 views::GridLayout::USE_PREF, 0, 0); | 121 views::GridLayout::USE_PREF, 0, 0); |
114 columns->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing); | 122 columns->AddPaddingColumn(0, unrelated_space_horiz); |
115 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 1, | 123 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 1, |
116 views::GridLayout::USE_PREF, 0, 0); | 124 views::GridLayout::USE_PREF, 0, 0); |
117 | 125 |
126 int icon_padding = icon_size.width() + label_spacing; | |
118 // Optional second row: [pad][pad][radio 1]. | 127 // Optional second row: [pad][pad][radio 1]. |
Peter Kasting
2017/04/26 18:26:25
Nit: This and comments below that say [pad][pad] s
ananta
2017/04/26 19:42:21
Done.
| |
119 columns = layout->AddColumnSet(1); | 128 columns = layout->AddColumnSet(1); |
120 columns->AddPaddingColumn(0, icon_size.width()); | 129 columns->AddPaddingColumn(0, icon_padding); |
121 columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | |
122 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, | 130 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, |
123 views::GridLayout::USE_PREF, 0, 0); | 131 views::GridLayout::USE_PREF, 0, 0); |
124 | 132 |
125 // Third row: [pad][pad][radio 2]. | 133 // Third row: [pad][pad][radio 2]. |
126 columns = layout->AddColumnSet(2); | 134 columns = layout->AddColumnSet(2); |
127 columns->AddPaddingColumn(0, icon_size.width()); | 135 columns->AddPaddingColumn(0, icon_padding); |
128 columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | |
129 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, | 136 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, |
130 views::GridLayout::USE_PREF, 0, 0); | 137 views::GridLayout::USE_PREF, 0, 0); |
131 | 138 |
132 // Fourth row: [pad][pad][button][pad][button]. | 139 // Fourth row: [pad][pad][button][pad][button]. |
133 columns = layout->AddColumnSet(3); | 140 columns = layout->AddColumnSet(3); |
134 columns->AddPaddingColumn(0, icon_size.width()); | 141 columns->AddPaddingColumn(0, icon_padding); |
135 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, | 142 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, |
136 views::GridLayout::USE_PREF, 0, 0); | 143 views::GridLayout::USE_PREF, 0, 0); |
137 columns->AddPaddingColumn(0, views::LayoutProvider::Get()->GetDistanceMetric( | 144 columns->AddPaddingColumn(0, button_spacing_horiz); |
138 views::DISTANCE_RELATED_BUTTON_HORIZONTAL)); | |
139 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, | 145 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, |
140 views::GridLayout::USE_PREF, 0, 0); | 146 views::GridLayout::USE_PREF, 0, 0); |
141 | 147 |
142 // Fifth row: [pad][pad][link]. | 148 // Fifth row: [pad][pad][link]. |
143 columns = layout->AddColumnSet(4); | 149 columns = layout->AddColumnSet(4); |
144 columns->AddPaddingColumn(0, icon_size.width()); | 150 columns->AddPaddingColumn(0, icon_size.width()); |
145 columns->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); | 151 columns->AddPaddingColumn(0, label_spacing); |
Peter Kasting
2017/04/26 18:26:25
Nit: This should be one padding column of size |ic
ananta
2017/04/26 19:42:21
Thanks done.
| |
146 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, | 152 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, |
147 views::GridLayout::USE_PREF, 0, 0); | 153 views::GridLayout::USE_PREF, 0, 0); |
148 | 154 |
149 // Optional fourth row: [button]. | 155 // Optional fourth row: [button]. |
150 columns = layout->AddColumnSet(5); | 156 columns = layout->AddColumnSet(5); |
151 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, | 157 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, |
152 views::GridLayout::USE_PREF, 0, 0); | 158 views::GridLayout::USE_PREF, 0, 0); |
153 | 159 |
154 // Optional fourth row: [divider] | 160 // Optional fourth row: [divider] |
155 columns = layout->AddColumnSet(6); | 161 columns = layout->AddColumnSet(6); |
156 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, | 162 columns->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, |
157 views::GridLayout::USE_PREF, 0, 0); | 163 views::GridLayout::USE_PREF, 0, 0); |
158 | 164 |
159 // Optional fifth row [checkbox][pad][button] | 165 // Optional fifth row [checkbox][pad][button] |
160 columns = layout->AddColumnSet(7); | 166 columns = layout->AddColumnSet(7); |
161 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, | 167 columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, |
162 views::GridLayout::USE_PREF, 0, 0); | 168 views::GridLayout::USE_PREF, 0, 0); |
163 columns->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing); | 169 columns->AddPaddingColumn(0, unrelated_space_horiz); |
164 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 1, | 170 columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 1, |
165 views::GridLayout::USE_PREF, 0, 0); | 171 views::GridLayout::USE_PREF, 0, 0); |
166 | 172 |
167 // First row. | 173 // First row. |
168 layout->StartRow(0, 0); | 174 layout->StartRow(0, 0); |
169 layout->AddView(icon); | 175 layout->AddView(icon); |
170 | 176 |
171 // Find out what experiment we are conducting. | 177 // Find out what experiment we are conducting. |
172 installer::ExperimentDetails experiment; | 178 installer::ExperimentDetails experiment; |
173 if (!install_static::SupportsRetentionExperiments() || | 179 if (!install_static::SupportsRetentionExperiments() || |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 layout->AddView(kill_chrome_); | 229 layout->AddView(kill_chrome_); |
224 } | 230 } |
225 | 231 |
226 views::LabelButton* accept_button = | 232 views::LabelButton* accept_button = |
227 views::MdTextButton::CreateSecondaryUiButton( | 233 views::MdTextButton::CreateSecondaryUiButton( |
228 this, l10n_util::GetStringUTF16(IDS_OK)); | 234 this, l10n_util::GetStringUTF16(IDS_OK)); |
229 accept_button->set_tag(BT_OK_BUTTON); | 235 accept_button->set_tag(BT_OK_BUTTON); |
230 | 236 |
231 views::Separator* separator = NULL; | 237 views::Separator* separator = NULL; |
232 if (experiment.flags & installer::kToastUiMakeDefault) { | 238 if (experiment.flags & installer::kToastUiMakeDefault) { |
233 // In this flavor we have some veritical space, then a separator line | 239 // In this flavor we have some vertical space, then a separator line |
234 // and the 'make default' checkbox and the OK button on the same row. | 240 // and the 'make default' checkbox and the OK button on the same row. |
235 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); | 241 layout->AddPaddingRow(0, unrelated_space_vert); |
236 layout->StartRow(0, 6); | 242 layout->StartRow(0, 6); |
237 separator = new views::Separator(); | 243 separator = new views::Separator(); |
238 layout->AddView(separator); | 244 layout->AddView(separator); |
239 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); | 245 layout->AddPaddingRow(0, unrelated_space_vert); |
240 | 246 |
241 layout->StartRow(0, 7); | 247 layout->StartRow(0, 7); |
242 make_default_ = new views::Checkbox( | 248 make_default_ = new views::Checkbox( |
243 l10n_util::GetStringUTF16(IDS_TRY_TOAST_SET_DEFAULT)); | 249 l10n_util::GetStringUTF16(IDS_TRY_TOAST_SET_DEFAULT)); |
244 make_default_->SetChecked(true); | 250 make_default_->SetChecked(true); |
245 layout->AddView(make_default_); | 251 layout->AddView(make_default_); |
246 layout->AddView(accept_button); | 252 layout->AddView(accept_button); |
247 } else { | 253 } else { |
248 // On this other flavor there is no checkbox, the OK button and possibly | 254 // On this other flavor there is no checkbox, the OK button and possibly |
249 // the cancel button are in the same row. | 255 // the cancel button are in the same row. |
250 layout->StartRowWithPadding(0, dont_bug_me_button ? 3 : 5, 0, 10); | 256 layout->StartRowWithPadding(0, dont_bug_me_button ? 3 : 5, 0, 10); |
251 layout->AddView(accept_button); | 257 layout->AddView(accept_button); |
252 if (dont_bug_me_button) { | 258 if (dont_bug_me_button) { |
253 // The dialog needs a "Don't bug me" as a button or as a radio button, | 259 // The dialog needs a "Don't bug me" as a button or as a radio button, |
254 // this the button case. | 260 // this the button case. |
255 views::LabelButton* cancel_button = | 261 views::LabelButton* cancel_button = |
256 views::MdTextButton::CreateSecondaryUiButton( | 262 views::MdTextButton::CreateSecondaryUiButton( |
257 this, l10n_util::GetStringUTF16(IDS_TRY_TOAST_CANCEL)); | 263 this, l10n_util::GetStringUTF16(IDS_TRY_TOAST_CANCEL)); |
258 cancel_button->set_tag(BT_CLOSE_BUTTON); | 264 cancel_button->set_tag(BT_CLOSE_BUTTON); |
259 layout->AddView(cancel_button); | 265 layout->AddView(cancel_button); |
260 } | 266 } |
261 } | 267 } |
262 | 268 |
263 if (experiment.flags & installer::kToastUiWhyLink) { | 269 if (experiment.flags & installer::kToastUiWhyLink) { |
264 layout->StartRowWithPadding(0, 4, 0, 10); | 270 layout->StartRowWithPadding(0, 4, 0, 10); |
265 views::Link* link = new views::Link( | 271 views::Link* link = |
266 l10n_util::GetStringUTF16(IDS_TRY_TOAST_WHY)); | 272 new views::Link(l10n_util::GetStringUTF16(IDS_TRY_TOAST_WHY)); |
267 link->set_listener(this); | 273 link->set_listener(this); |
268 layout->AddView(link); | 274 layout->AddView(link); |
269 } | 275 } |
270 | 276 |
271 // We resize the window according to the layout manager. This takes into | 277 // We resize the window according to the layout manager. This takes into |
272 // account the differences between XP and Vista fonts and buttons. | 278 // account the differences between XP and Vista fonts and buttons. |
273 layout->Layout(root_view); | 279 layout->Layout(root_view); |
274 gfx::Size preferred = layout->GetPreferredSize(root_view); | 280 gfx::Size preferred = layout->GetPreferredSize(root_view); |
275 if (separator) { | 281 if (separator) { |
276 int separator_height = separator->GetPreferredSize().height(); | 282 int separator_height = separator->GetPreferredSize().height(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 // |rcWork| is the work area, accounting for the visible taskbars. | 314 // |rcWork| is the work area, accounting for the visible taskbars. |
309 origin.set_x(is_RTL ? info.rcWork.left : info.rcWork.right - size.width()); | 315 origin.set_x(is_RTL ? info.rcWork.left : info.rcWork.right - size.width()); |
310 origin.set_y(info.rcWork.bottom - size.height()); | 316 origin.set_y(info.rcWork.bottom - size.height()); |
311 } | 317 } |
312 | 318 |
313 return gfx::Rect(origin, size); | 319 return gfx::Rect(origin, size); |
314 } | 320 } |
315 | 321 |
316 void TryChromeDialogView::SetToastRegion(HWND window, int w, int h) { | 322 void TryChromeDialogView::SetToastRegion(HWND window, int w, int h) { |
317 static const POINT polygon[] = { | 323 static const POINT polygon[] = { |
318 {0, 4}, {1, 2}, {2, 1}, {4, 0}, // Left side. | 324 {0, 4}, {1, 2}, {2, 1}, {4, 0}, // Left side. |
319 {w-4, 0}, {w-2, 1}, {w-1, 2}, {w, 4}, // Right side. | 325 {w - 4, 0}, {w - 2, 1}, {w - 1, 2}, {w, 4}, // Right side. |
320 {w, h}, {0, h} | 326 {w, h}, {0, h}}; |
321 }; | |
322 HRGN region = ::CreatePolygonRgn(polygon, arraysize(polygon), WINDING); | 327 HRGN region = ::CreatePolygonRgn(polygon, arraysize(polygon), WINDING); |
323 ::SetWindowRgn(window, region, FALSE); | 328 ::SetWindowRgn(window, region, FALSE); |
324 } | 329 } |
325 | 330 |
326 void TryChromeDialogView::ButtonPressed(views::Button* sender, | 331 void TryChromeDialogView::ButtonPressed(views::Button* sender, |
327 const ui::Event& event) { | 332 const ui::Event& event) { |
328 if (sender->tag() == BT_DONT_BUG_RADIO) { | 333 if (sender->tag() == BT_DONT_BUG_RADIO) { |
329 if (make_default_) { | 334 if (make_default_) { |
330 make_default_->SetChecked(false); | 335 make_default_->SetChecked(false); |
331 make_default_->SetVisible(false); | 336 make_default_->SetVisible(false); |
(...skipping 18 matching lines...) Expand all Loading... | |
350 else if (dont_try_chrome_ && dont_try_chrome_->checked()) | 355 else if (dont_try_chrome_ && dont_try_chrome_->checked()) |
351 result_ = NOT_NOW; | 356 result_ = NOT_NOW; |
352 else if (kill_chrome_ && kill_chrome_->checked()) | 357 else if (kill_chrome_ && kill_chrome_->checked()) |
353 result_ = UNINSTALL_CHROME; | 358 result_ = UNINSTALL_CHROME; |
354 else | 359 else |
355 NOTREACHED() << "Unknown radio button selected"; | 360 NOTREACHED() << "Unknown radio button selected"; |
356 } | 361 } |
357 | 362 |
358 if (make_default_) { | 363 if (make_default_) { |
359 if ((result_ == TRY_CHROME) && make_default_->checked()) | 364 if ((result_ == TRY_CHROME) && make_default_->checked()) |
360 result_ = TRY_CHROME_AS_DEFAULT; | 365 result_ = TRY_CHROME_AS_DEFAULT; |
361 } | 366 } |
362 | 367 |
363 popup_->Close(); | 368 popup_->Close(); |
364 base::MessageLoop::current()->QuitWhenIdle(); | 369 base::MessageLoop::current()->QuitWhenIdle(); |
365 } | 370 } |
366 | 371 |
367 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 372 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
368 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 373 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
369 } | 374 } |
OLD | NEW |