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

Side by Side Diff: chrome/browser/chromeos/attestation/platform_verification_dialog.cc

Issue 2919903002: Remove references to ui/views/layout/layout_constants.h (Closed)
Patch Set: Created 3 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 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"
11 #include "chrome/browser/ui/browser_dialogs.h" 11 #include "chrome/browser/ui/browser_dialogs.h"
12 #include "chrome/browser/ui/browser_finder.h" 12 #include "chrome/browser/ui/browser_finder.h"
13 #include "chrome/browser/ui/browser_navigator.h" 13 #include "chrome/browser/ui/browser_navigator.h"
14 #include "chrome/browser/ui/browser_window.h" 14 #include "chrome/browser/ui/browser_window.h"
15 #include "chrome/browser/ui/singleton_tabs.h" 15 #include "chrome/browser/ui/singleton_tabs.h"
16 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
16 #include "chrome/common/url_constants.h" 17 #include "chrome/common/url_constants.h"
17 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
18 #include "components/constrained_window/constrained_window_views.h" 19 #include "components/constrained_window/constrained_window_views.h"
19 #include "components/strings/grit/components_strings.h" 20 #include "components/strings/grit/components_strings.h"
20 #include "content/public/browser/navigation_handle.h" 21 #include "content/public/browser/navigation_handle.h"
21 #include "content/public/browser/web_contents.h" 22 #include "content/public/browser/web_contents.h"
22 #include "extensions/browser/extension_registry.h" 23 #include "extensions/browser/extension_registry.h"
23 #include "extensions/common/extension.h" 24 #include "extensions/common/extension.h"
24 #include "ui/aura/window.h" 25 #include "ui/aura/window.h"
25 #include "ui/base/l10n/l10n_util.h" 26 #include "ui/base/l10n/l10n_util.h"
26 #include "ui/base/page_transition_types.h" 27 #include "ui/base/page_transition_types.h"
27 #include "ui/views/border.h" 28 #include "ui/views/border.h"
28 #include "ui/views/controls/styled_label.h" 29 #include "ui/views/controls/styled_label.h"
29 #include "ui/views/layout/fill_layout.h" 30 #include "ui/views/layout/fill_layout.h"
30 #include "ui/views/layout/layout_constants.h"
31 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
32 #include "ui/views/window/dialog_delegate.h" 32 #include "ui/views/window/dialog_delegate.h"
33 33
34 namespace chromeos { 34 namespace chromeos {
35 namespace attestation { 35 namespace attestation {
36 36
37 namespace { 37 namespace {
38 38
39 const int kDialogMaxWidthInPixel = 400; 39 const int kDialogMaxWidthInPixel = 400;
40 40
(...skipping 27 matching lines...) Expand all
68 } 68 }
69 69
70 PlatformVerificationDialog::PlatformVerificationDialog( 70 PlatformVerificationDialog::PlatformVerificationDialog(
71 content::WebContents* web_contents, 71 content::WebContents* web_contents,
72 const base::string16& domain, 72 const base::string16& domain,
73 const ConsentCallback& callback) 73 const ConsentCallback& callback)
74 : content::WebContentsObserver(web_contents), 74 : content::WebContentsObserver(web_contents),
75 domain_(domain), 75 domain_(domain),
76 callback_(callback) { 76 callback_(callback) {
77 SetLayoutManager(new views::FillLayout()); 77 SetLayoutManager(new views::FillLayout());
78 SetBorder(views::CreateEmptyBorder(0, views::kButtonHEdgeMarginNew, 0, 78
79 views::kButtonHEdgeMarginNew)); 79 gfx::Insets dialog_insets = ChromeLayoutProvider::Get()->GetInsetsMetric(
80 views::INSETS_DIALOG_CONTENTS);
81
Peter Kasting 2017/06/01 23:59:56 Nit: Blank line unnecessary
ananta 2017/06/02 00:16:36 Done.
82 SetBorder(views::CreateEmptyBorder(0, dialog_insets.left(), 0,
83 dialog_insets.right()));
80 const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE); 84 const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE);
81 std::vector<size_t> offsets; 85 std::vector<size_t> offsets;
82 base::string16 headline = l10n_util::GetStringFUTF16( 86 base::string16 headline = l10n_util::GetStringFUTF16(
83 IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets); 87 IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets);
84 views::StyledLabel* headline_label = new views::StyledLabel(headline, this); 88 views::StyledLabel* headline_label = new views::StyledLabel(headline, this);
85 headline_label->AddStyleRange( 89 headline_label->AddStyleRange(
86 gfx::Range(offsets[1], offsets[1] + learn_more.size()), 90 gfx::Range(offsets[1], offsets[1] + learn_more.size()),
87 views::StyledLabel::RangeStyleInfo::CreateForLink()); 91 views::StyledLabel::RangeStyleInfo::CreateForLink());
88 AddChildView(headline_label); 92 AddChildView(headline_label);
89 chrome::RecordDialogCreation(chrome::DialogIdentifier::PLATFORM_VERIFICATION); 93 chrome::RecordDialogCreation(chrome::DialogIdentifier::PLATFORM_VERIFICATION);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 navigation_handle->IsSameDocument()) 162 navigation_handle->IsSameDocument())
159 return; 163 return;
160 164
161 views::Widget* widget = GetWidget(); 165 views::Widget* widget = GetWidget();
162 if (widget) 166 if (widget)
163 widget->Close(); 167 widget->Close();
164 } 168 }
165 169
166 } // namespace attestation 170 } // namespace attestation
167 } // namespace chromeos 171 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698