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

Side by Side Diff: chrome/browser/first_run/try_chrome_dialog_view.cc

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase (conflict in layout_delegate.h due to r457774) Created 3 years, 9 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/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/macros.h" 10 #include "base/macros.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 layout->AddView(icon); 171 layout->AddView(icon);
172 172
173 // Find out what experiment we are conducting. 173 // Find out what experiment we are conducting.
174 installer::ExperimentDetails experiment; 174 installer::ExperimentDetails experiment;
175 if (!BrowserDistribution::GetDistribution()->HasUserExperiments() || 175 if (!BrowserDistribution::GetDistribution()->HasUserExperiments() ||
176 !installer::CreateExperimentDetails(flavor_, &experiment) || 176 !installer::CreateExperimentDetails(flavor_, &experiment) ||
177 !experiment.heading) { 177 !experiment.heading) {
178 NOTREACHED() << "Cannot determine which headline to show."; 178 NOTREACHED() << "Cannot determine which headline to show.";
179 return DIALOG_ERROR; 179 return DIALOG_ERROR;
180 } 180 }
181 views::Label* label = new views::Label( 181 views::Label* label =
182 l10n_util::GetStringUTF16(experiment.heading), 182 new views::Label(l10n_util::GetStringUTF16(experiment.heading),
183 rb.GetFontList(ui::ResourceBundle::MediumFont)); 183 views::style::CONTEXT_DIALOG_TITLE);
184 label->SetMultiLine(true); 184 label->SetMultiLine(true);
185 label->SizeToFit(200); 185 label->SizeToFit(200);
186 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 186 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
187 layout->AddView(label); 187 layout->AddView(label);
188 // The close button is custom. 188 // The close button is custom.
189 views::ImageButton* close_button = new views::ImageButton(this); 189 views::ImageButton* close_button = new views::ImageButton(this);
190 close_button->SetImage(views::CustomButton::STATE_NORMAL, 190 close_button->SetImage(views::CustomButton::STATE_NORMAL,
191 rb.GetNativeImageNamed(IDR_CLOSE_2).ToImageSkia()); 191 rb.GetNativeImageNamed(IDR_CLOSE_2).ToImageSkia());
192 close_button->SetImage(views::CustomButton::STATE_HOVERED, 192 close_button->SetImage(views::CustomButton::STATE_HOVERED,
193 rb.GetNativeImageNamed(IDR_CLOSE_2_H).ToImageSkia()); 193 rb.GetNativeImageNamed(IDR_CLOSE_2_H).ToImageSkia());
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 result_ = TRY_CHROME_AS_DEFAULT; 362 result_ = TRY_CHROME_AS_DEFAULT;
363 } 363 }
364 364
365 popup_->Close(); 365 popup_->Close();
366 base::MessageLoop::current()->QuitWhenIdle(); 366 base::MessageLoop::current()->QuitWhenIdle();
367 } 367 }
368 368
369 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { 369 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) {
370 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); 370 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW);
371 } 371 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698