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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 if (!dist->GetExperimentDetails(&experiment, flavor_) || | 171 if (!dist->GetExperimentDetails(&experiment, flavor_) || |
172 !experiment.heading) { | 172 !experiment.heading) { |
173 NOTREACHED() << "Cannot determine which headline to show."; | 173 NOTREACHED() << "Cannot determine which headline to show."; |
174 return DIALOG_ERROR; | 174 return DIALOG_ERROR; |
175 } | 175 } |
176 views::Label* label = new views::Label( | 176 views::Label* label = new views::Label( |
177 l10n_util::GetStringUTF16(experiment.heading)); | 177 l10n_util::GetStringUTF16(experiment.heading)); |
178 label->SetFont(rb.GetFont(ui::ResourceBundle::MediumBoldFont)); | 178 label->SetFont(rb.GetFont(ui::ResourceBundle::MediumBoldFont)); |
179 label->SetMultiLine(true); | 179 label->SetMultiLine(true); |
180 label->SizeToFit(200); | 180 label->SizeToFit(200); |
181 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 181 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
182 layout->AddView(label); | 182 layout->AddView(label); |
183 // The close button is custom. | 183 // The close button is custom. |
184 views::ImageButton* close_button = new views::ImageButton(this); | 184 views::ImageButton* close_button = new views::ImageButton(this); |
185 close_button->SetImage(views::CustomButton::BS_NORMAL, | 185 close_button->SetImage(views::CustomButton::BS_NORMAL, |
186 rb.GetNativeImageNamed(IDR_CLOSE_BAR).ToImageSkia()); | 186 rb.GetNativeImageNamed(IDR_CLOSE_BAR).ToImageSkia()); |
187 close_button->SetImage(views::CustomButton::BS_HOT, | 187 close_button->SetImage(views::CustomButton::BS_HOT, |
188 rb.GetNativeImageNamed(IDR_CLOSE_BAR_H).ToImageSkia()); | 188 rb.GetNativeImageNamed(IDR_CLOSE_BAR_H).ToImageSkia()); |
189 close_button->SetImage(views::CustomButton::BS_PUSHED, | 189 close_button->SetImage(views::CustomButton::BS_PUSHED, |
190 rb.GetNativeImageNamed(IDR_CLOSE_BAR_P).ToImageSkia()); | 190 rb.GetNativeImageNamed(IDR_CLOSE_BAR_P).ToImageSkia()); |
191 close_button->set_tag(BT_CLOSE_BUTTON); | 191 close_button->set_tag(BT_CLOSE_BUTTON); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 result_ = TRY_CHROME_AS_DEFAULT; | 341 result_ = TRY_CHROME_AS_DEFAULT; |
342 } | 342 } |
343 | 343 |
344 popup_->Close(); | 344 popup_->Close(); |
345 MessageLoop::current()->Quit(); | 345 MessageLoop::current()->Quit(); |
346 } | 346 } |
347 | 347 |
348 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { | 348 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { |
349 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); | 349 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); |
350 } | 350 } |
OLD | NEW |