| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 PlatformVerificationDialog::PlatformVerificationDialog( | 68 PlatformVerificationDialog::PlatformVerificationDialog( |
| 69 content::WebContents* web_contents, | 69 content::WebContents* web_contents, |
| 70 const base::string16& domain, | 70 const base::string16& domain, |
| 71 const ConsentCallback& callback) | 71 const ConsentCallback& callback) |
| 72 : content::WebContentsObserver(web_contents), | 72 : content::WebContentsObserver(web_contents), |
| 73 domain_(domain), | 73 domain_(domain), |
| 74 callback_(callback) { | 74 callback_(callback) { |
| 75 SetLayoutManager(new views::FillLayout()); | 75 SetLayoutManager(new views::FillLayout()); |
| 76 SetBorder(views::Border::CreateEmptyBorder( | 76 SetBorder(views::CreateEmptyBorder(0, views::kButtonHEdgeMarginNew, 0, |
| 77 0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); | 77 views::kButtonHEdgeMarginNew)); |
| 78 const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 78 const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 79 std::vector<size_t> offsets; | 79 std::vector<size_t> offsets; |
| 80 base::string16 headline = l10n_util::GetStringFUTF16( | 80 base::string16 headline = l10n_util::GetStringFUTF16( |
| 81 IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets); | 81 IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets); |
| 82 views::StyledLabel* headline_label = new views::StyledLabel(headline, this); | 82 views::StyledLabel* headline_label = new views::StyledLabel(headline, this); |
| 83 headline_label->AddStyleRange( | 83 headline_label->AddStyleRange( |
| 84 gfx::Range(offsets[1], offsets[1] + learn_more.size()), | 84 gfx::Range(offsets[1], offsets[1] + learn_more.size()), |
| 85 views::StyledLabel::RangeStyleInfo::CreateForLink()); | 85 views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 86 AddChildView(headline_label); | 86 AddChildView(headline_label); |
| 87 } | 87 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void PlatformVerificationDialog::DidStartNavigationToPendingEntry( | 152 void PlatformVerificationDialog::DidStartNavigationToPendingEntry( |
| 153 const GURL& url, | 153 const GURL& url, |
| 154 content::ReloadType reload_type) { | 154 content::ReloadType reload_type) { |
| 155 views::Widget* widget = GetWidget(); | 155 views::Widget* widget = GetWidget(); |
| 156 if (widget) | 156 if (widget) |
| 157 widget->Close(); | 157 widget->Close(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace attestation | 160 } // namespace attestation |
| 161 } // namespace chromeos | 161 } // namespace chromeos |
| OLD | NEW |