| OLD | NEW |
| 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/chromeos/attestation/platform_verification_dialog.h" | 5 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "chrome/browser/ui/singleton_tabs.h" | 10 #include "chrome/browser/ui/singleton_tabs.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 PlatformVerificationDialog::PlatformVerificationDialog( | 59 PlatformVerificationDialog::PlatformVerificationDialog( |
| 60 Browser* browser, | 60 Browser* browser, |
| 61 const base::string16& domain, | 61 const base::string16& domain, |
| 62 const PlatformVerificationFlow::Delegate::ConsentCallback& callback) | 62 const PlatformVerificationFlow::Delegate::ConsentCallback& callback) |
| 63 : browser_(browser), | 63 : browser_(browser), |
| 64 domain_(domain), | 64 domain_(domain), |
| 65 callback_(callback) { | 65 callback_(callback) { |
| 66 SetLayoutManager(new views::FillLayout()); | 66 SetLayoutManager(new views::FillLayout()); |
| 67 set_border(views::Border::CreateEmptyBorder( | 67 SetBorder(views::Border::CreateEmptyBorder( |
| 68 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); | 68 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); |
| 69 const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 69 const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 70 std::vector<size_t> offsets; | 70 std::vector<size_t> offsets; |
| 71 base::string16 headline = l10n_util::GetStringFUTF16( | 71 base::string16 headline = l10n_util::GetStringFUTF16( |
| 72 IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets); | 72 IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets); |
| 73 views::StyledLabel* headline_label = new views::StyledLabel(headline, this); | 73 views::StyledLabel* headline_label = new views::StyledLabel(headline, this); |
| 74 headline_label->AddStyleRange( | 74 headline_label->AddStyleRange( |
| 75 gfx::Range(offsets[1], offsets[1] + learn_more.size()), | 75 gfx::Range(offsets[1], offsets[1] + learn_more.size()), |
| 76 views::StyledLabel::RangeStyleInfo::CreateForLink()); | 76 views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 77 AddChildView(headline_label); | 77 AddChildView(headline_label); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 void PlatformVerificationDialog::StyledLabelLinkClicked(const gfx::Range& range, | 113 void PlatformVerificationDialog::StyledLabelLinkClicked(const gfx::Range& range, |
| 114 int event_flags) { | 114 int event_flags) { |
| 115 chrome::ShowSingletonTab(browser_, GURL( | 115 chrome::ShowSingletonTab(browser_, GURL( |
| 116 chrome::kAttestationForContentProtectionLearnMoreURL)); | 116 chrome::kAttestationForContentProtectionLearnMoreURL)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace attestation | 119 } // namespace attestation |
| 120 } // namespace chromeos | 120 } // namespace chromeos |
| OLD | NEW |