 Chromium Code Reviews
 Chromium Code Reviews Issue 2919903002:
  Remove references to ui/views/layout/layout_constants.h  (Closed)
    
  
    Issue 2919903002:
  Remove references to ui/views/layout/layout_constants.h  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/multiprofiles_intro_dialog.h" | 5 #include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" | 
| 6 | 6 | 
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" | 
| 8 #include "base/macros.h" | 8 #include "base/macros.h" | 
| 9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" | 
| 10 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | |
| 10 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" | 
| 11 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" | 
| 12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" | 
| 13 #include "ui/views/border.h" | 14 #include "ui/views/border.h" | 
| 14 #include "ui/views/controls/button/checkbox.h" | 15 #include "ui/views/controls/button/checkbox.h" | 
| 15 #include "ui/views/controls/label.h" | 16 #include "ui/views/controls/label.h" | 
| 16 #include "ui/views/layout/fill_layout.h" | 17 #include "ui/views/layout/fill_layout.h" | 
| 17 #include "ui/views/layout/layout_constants.h" | |
| 18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" | 
| 19 #include "ui/views/window/dialog_delegate.h" | 19 #include "ui/views/window/dialog_delegate.h" | 
| 20 | 20 | 
| 21 namespace chromeos { | 21 namespace chromeos { | 
| 22 | 22 | 
| 23 namespace { | 23 namespace { | 
| 24 | 24 | 
| 25 // Default width of the dialog. | 25 // Default width of the dialog. | 
| 26 const int kDefaultWidth = 448; | 26 const int kDefaultWidth = 448; | 
| 27 | 27 | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 return l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_HEADLINE); | 99 return l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_HEADLINE); | 
| 100 } | 100 } | 
| 101 | 101 | 
| 102 gfx::Size MultiprofilesIntroView::CalculatePreferredSize() const { | 102 gfx::Size MultiprofilesIntroView::CalculatePreferredSize() const { | 
| 103 return gfx::Size( | 103 return gfx::Size( | 
| 104 kDefaultWidth, | 104 kDefaultWidth, | 
| 105 GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); | 105 GetLayoutManager()->GetPreferredHeightForWidth(this, kDefaultWidth)); | 
| 106 } | 106 } | 
| 107 | 107 | 
| 108 void MultiprofilesIntroView::InitDialog() { | 108 void MultiprofilesIntroView::InitDialog() { | 
| 109 SetBorder(views::CreateEmptyBorder(views::kPanelVertMargin, | 109 gfx::Insets dialog_insets = ChromeLayoutProvider::Get()->GetInsetsMetric( | 
| 110 views::kButtonHEdgeMarginNew, 0, | 110 views::INSETS_DIALOG_CONTENTS); | 
| 111 views::kButtonHEdgeMarginNew)); | 111 | 
| 112 SetBorder(views::CreateEmptyBorder(dialog_insets.top(), dialog_insets.left(), | |
| 
Peter Kasting
2017/06/01 23:59:56
This looks like INSETS_DIALOG_TITLE.
 
ananta
2017/06/02 00:16:36
Done.
 | |
| 113 0, dialog_insets.right()); | |
| 112 SetLayoutManager(new views::FillLayout()); | 114 SetLayoutManager(new views::FillLayout()); | 
| 113 | 115 | 
| 114 // Explanation string | 116 // Explanation string | 
| 115 views::Label* label = new views::Label( | 117 views::Label* label = new views::Label( | 
| 116 l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_MESSAGE)); | 118 l10n_util::GetStringUTF16(IDS_MULTIPROFILES_INTRO_MESSAGE)); | 
| 117 label->SetMultiLine(true); | 119 label->SetMultiLine(true); | 
| 118 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 120 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 
| 119 AddChildView(label); | 121 AddChildView(label); | 
| 120 } | 122 } | 
| 121 | 123 | 
| 122 } // namespace | 124 } // namespace | 
| 123 | 125 | 
| 124 //////////////////////////////////////////////////////////////////////////////// | 126 //////////////////////////////////////////////////////////////////////////////// | 
| 125 // Factory function. | 127 // Factory function. | 
| 126 | 128 | 
| 127 void ShowMultiprofilesIntroDialog(const base::Callback<void(bool)> on_accept) { | 129 void ShowMultiprofilesIntroDialog(const base::Callback<void(bool)> on_accept) { | 
| 128 MultiprofilesIntroView::ShowDialog(on_accept); | 130 MultiprofilesIntroView::ShowDialog(on_accept); | 
| 129 } | 131 } | 
| 130 | 132 | 
| 131 } // namespace chromeos | 133 } // namespace chromeos | 
| OLD | NEW |