Chromium Code Reviews| Index: chrome/browser/ui/views/layout_utils.cc |
| diff --git a/chrome/browser/ui/views/layout_utils.cc b/chrome/browser/ui/views/layout_utils.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..41aeaf148ae510a2eb98800e728a5ef604be823c |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/layout_utils.cc |
| @@ -0,0 +1,25 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/views/layout_utils.h" |
| +#include "chrome/browser/ui/views/harmony/layout_delegate.h" |
|
sky
2016/11/14 21:49:32
newline between lines 5 and 6.
Elly Fong-Jones
2016/11/15 17:13:39
Done.
|
| +#include "ui/views/layout/grid_layout.h" |
| +#include "ui/views/view.h" |
| + |
| +namespace chrome { |
| +namespace layout_utils { |
| + |
| +views::GridLayout* CreatePanelLayout(views::View* host) { |
|
sky
2016/11/14 21:49:32
optional: Consider having this set the returned Gr
Elly Fong-Jones
2016/11/15 17:13:39
Done.
|
| + views::GridLayout* layout = new views::GridLayout(host); |
| + chrome::LayoutDelegate* delegate = |
| + chrome::LayoutDelegate::GetActiveInstance(); |
| + layout->SetInsets(gfx::Insets( |
| + delegate->GetLayoutDistance(chrome::LayoutDelegate::PANEL_VERT_MARGIN), |
| + delegate->GetLayoutDistance( |
| + chrome::LayoutDelegate::BUTTON_HEDGE_MARGIN_NEW))); |
| + return layout; |
| +} |
| + |
| +} // namespace layout_utils |
| +} // namespace chrome |