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

Side by Side Diff: chrome/browser/ui/views/platform_keys_certificate_selector_chromeos.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/platform_keys_certificate_selector_chromeos.h" 5 #include "chrome/browser/ui/views/platform_keys_certificate_selector_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 29 matching lines...) Expand all
40 const base::string16 name = base::ASCIIToUTF16(extension_name_); 40 const base::string16 name = base::ASCIIToUTF16(extension_name_);
41 41
42 size_t offset; 42 size_t offset;
43 const base::string16 text = l10n_util::GetStringFUTF16( 43 const base::string16 text = l10n_util::GetStringFUTF16(
44 IDS_PLATFORM_KEYS_SELECT_CERT_DIALOG_TEXT, name, &offset); 44 IDS_PLATFORM_KEYS_SELECT_CERT_DIALOG_TEXT, name, &offset);
45 45
46 std::unique_ptr<views::StyledLabel> label( 46 std::unique_ptr<views::StyledLabel> label(
47 new views::StyledLabel(text, nullptr /* no listener */)); 47 new views::StyledLabel(text, nullptr /* no listener */));
48 48
49 views::StyledLabel::RangeStyleInfo bold_style; 49 views::StyledLabel::RangeStyleInfo bold_style;
50 bold_style.font_style = gfx::Font::BOLD; 50 bold_style.weight = gfx::Font::Weight::BOLD;
51 label->AddStyleRange(gfx::Range(offset, offset + name.size()), bold_style); 51 label->AddStyleRange(gfx::Range(offset, offset + name.size()), bold_style);
52 CertificateSelector::InitWithText(std::move(label)); 52 CertificateSelector::InitWithText(std::move(label));
53 } 53 }
54 54
55 bool PlatformKeysCertificateSelector::Cancel() { 55 bool PlatformKeysCertificateSelector::Cancel() {
56 DCHECK(!callback_.is_null()); 56 DCHECK(!callback_.is_null());
57 base::ResetAndReturn(&callback_).Run(nullptr); 57 base::ResetAndReturn(&callback_).Run(nullptr);
58 return true; 58 return true;
59 } 59 }
60 60
(...skipping 13 matching lines...) Expand all
74 const base::Callback<void(const scoped_refptr<net::X509Certificate>&)>& 74 const base::Callback<void(const scoped_refptr<net::X509Certificate>&)>&
75 callback) { 75 callback) {
76 PlatformKeysCertificateSelector* selector = 76 PlatformKeysCertificateSelector* selector =
77 new PlatformKeysCertificateSelector(certificates, extension_name, 77 new PlatformKeysCertificateSelector(certificates, extension_name,
78 callback, web_contents); 78 callback, web_contents);
79 selector->Init(); 79 selector->Init();
80 selector->Show(); 80 selector->Show();
81 } 81 }
82 82
83 } // namespace chromeos 83 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698