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/first_run/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/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 const string16 try_it(l10n_util::GetStringUTF16(IDS_TRY_TOAST_TRY_OPT)); | 193 const string16 try_it(l10n_util::GetStringUTF16(IDS_TRY_TOAST_TRY_OPT)); |
194 layout->StartRowWithPadding(0, 1, 0, 10); | 194 layout->StartRowWithPadding(0, 1, 0, 10); |
195 try_chrome_ = new views::RadioButton(try_it, 1); | 195 try_chrome_ = new views::RadioButton(try_it, 1); |
196 try_chrome_->SetChecked(true); | 196 try_chrome_->SetChecked(true); |
197 try_chrome_->set_tag(BT_TRY_IT_RADIO); | 197 try_chrome_->set_tag(BT_TRY_IT_RADIO); |
198 try_chrome_->set_listener(this); | 198 try_chrome_->set_listener(this); |
199 layout->AddView(try_chrome_); | 199 layout->AddView(try_chrome_); |
200 | 200 |
201 // Decide if the don't bug me is a button or a radio button. | 201 // Decide if the don't bug me is a button or a radio button. |
202 bool dont_bug_me_button = | 202 bool dont_bug_me_button = |
203 experiment.flags & BrowserDistribution::kDontBugMeAsButton ? true : false; | 203 ((experiment.flags & BrowserDistribution::kDontBugMeAsButton) != 0); |
204 | 204 |
205 // Optional third and fourth row views. | 205 // Optional third and fourth row views. |
206 if (!dont_bug_me_button) { | 206 if (!dont_bug_me_button) { |
207 layout->StartRow(0, 1); | 207 layout->StartRow(0, 1); |
208 const string16 decline(l10n_util::GetStringUTF16(IDS_TRY_TOAST_CANCEL)); | 208 const string16 decline(l10n_util::GetStringUTF16(IDS_TRY_TOAST_CANCEL)); |
209 dont_try_chrome_ = new views::RadioButton(decline, 1); | 209 dont_try_chrome_ = new views::RadioButton(decline, 1); |
210 dont_try_chrome_->set_tag(BT_DONT_BUG_RADIO); | 210 dont_try_chrome_->set_tag(BT_DONT_BUG_RADIO); |
211 dont_try_chrome_->set_listener(this); | 211 dont_try_chrome_->set_listener(this); |
212 layout->AddView(dont_try_chrome_); | 212 layout->AddView(dont_try_chrome_); |
213 } | 213 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 result_ = TRY_CHROME_AS_DEFAULT; | 340 result_ = TRY_CHROME_AS_DEFAULT; |
341 } | 341 } |
342 | 342 |
343 popup_->Close(); | 343 popup_->Close(); |
344 MessageLoop::current()->Quit(); | 344 MessageLoop::current()->Quit(); |
345 } | 345 } |
346 | 346 |
347 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 347 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
348 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 348 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
349 } | 349 } |
OLD | NEW |