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

Side by Side Diff: chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sync/profile_signin_confirmation_dialog_views. h" 5 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views. h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 views::StyledLabel* prompt_label = new views::StyledLabel(prompt_text, this); 156 views::StyledLabel* prompt_label = new views::StyledLabel(prompt_text, this);
157 prompt_label->SetDisplayedOnBackgroundColor(kPromptBarBackgroundColor); 157 prompt_label->SetDisplayedOnBackgroundColor(kPromptBarBackgroundColor);
158 158
159 views::StyledLabel::RangeStyleInfo bold_style; 159 views::StyledLabel::RangeStyleInfo bold_style;
160 bold_style.weight = gfx::Font::Weight::BOLD; 160 bold_style.weight = gfx::Font::Weight::BOLD;
161 prompt_label->AddStyleRange( 161 prompt_label->AddStyleRange(
162 gfx::Range(offset, offset + domain.size()), bold_style); 162 gfx::Range(offset, offset + domain.size()), bold_style);
163 163
164 // Create the prompt bar. 164 // Create the prompt bar.
165 views::View* prompt_bar = new views::View; 165 views::View* prompt_bar = new views::View;
166 prompt_bar->SetBorder(views::Border::CreateSolidSidedBorder( 166 prompt_bar->SetBorder(views::CreateSolidSidedBorder(
167 1, 0, 1, 0, 167 1, 0, 1, 0,
168 ui::GetSigninConfirmationPromptBarColor( 168 ui::GetSigninConfirmationPromptBarColor(
169 GetNativeTheme(), ui::kSigninConfirmationPromptBarBorderAlpha))); 169 GetNativeTheme(), ui::kSigninConfirmationPromptBarBorderAlpha)));
170 prompt_bar->set_background(views::Background::CreateSolidBackground( 170 prompt_bar->set_background(views::Background::CreateSolidBackground(
171 kPromptBarBackgroundColor)); 171 kPromptBarBackgroundColor));
172 172
173 // Create the explanation label. 173 // Create the explanation label.
174 std::vector<size_t> offsets; 174 std::vector<size_t> offsets;
175 const base::string16 learn_more_text = 175 const base::string16 learn_more_text =
176 l10n_util::GetStringUTF16( 176 l10n_util::GetStringUTF16(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 void ProfileSigninConfirmationDialogViews::ButtonPressed( 243 void ProfileSigninConfirmationDialogViews::ButtonPressed(
244 views::Button* sender, 244 views::Button* sender,
245 const ui::Event& event) { 245 const ui::Event& event) {
246 DCHECK(prompt_for_new_profile_); 246 DCHECK(prompt_for_new_profile_);
247 if (delegate_) { 247 if (delegate_) {
248 delegate_->OnContinueSignin(); 248 delegate_->OnContinueSignin();
249 delegate_ = NULL; 249 delegate_ = NULL;
250 } 250 }
251 GetWidget()->Close(); 251 GetWidget()->Close();
252 } 252 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/subtle_notification_view.cc ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698