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

Side by Side Diff: chrome/browser/ui/views/harmony/harmony_layout_delegate.h

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Fix warning which causes one of the bots to fail Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_
7 7
8 #include "chrome/browser/ui/views/harmony/layout_delegate.h" 8 #include <memory>
Peter Kasting 2017/04/06 08:13:36 Nit: Why this #include?
kylix_rd 2017/04/06 16:48:19 Probably an over zealous copy operation as I initi
9 9
10 class HarmonyLayoutDelegate : public LayoutDelegate { 10 #include "base/macros.h"
11 #include "chrome/browser/ui/views/harmony/chrome_layout_delegate.h"
12 #include "ui/gfx/geometry/insets.h"
13 #include "ui/views/layout/grid_layout.h"
Peter Kasting 2017/04/06 08:13:36 Nit: insets.h and grid_layout.h shouldn't be neces
kylix_rd 2017/04/06 16:48:19 Good to know. It's a subtle exception to the IWYU
14
15 class HarmonyLayoutDelegate : public ChromeLayoutDelegate {
11 public: 16 public:
12 // The Harmony layout unit. All distances are in terms of this unit. 17 // The Harmony layout unit. All distances are in terms of this unit.
13 static constexpr int kHarmonyLayoutUnit = 16; 18 static constexpr int kHarmonyLayoutUnit = 16;
14 19
15 HarmonyLayoutDelegate() {} 20 HarmonyLayoutDelegate() {}
16 ~HarmonyLayoutDelegate() override {} 21 ~HarmonyLayoutDelegate() override {}
17 22
18 // Returns the singleton HarmonyLayoutDelegate instance. 23 gfx::Insets GetInsetsMetric(ChromeInsetsMetric metric) const override;
19 static HarmonyLayoutDelegate* Get(); 24 int GetDistanceMetric(ChromeDistanceMetric metric) const override;
20
21 // views::LayoutDelegate:
22 int GetMetric(Metric metric) const override;
23 views::GridLayout::Alignment GetControlLabelGridAlignment() const override; 25 views::GridLayout::Alignment GetControlLabelGridAlignment() const override;
24 bool UseExtraDialogPadding() const override; 26 bool UseExtraDialogPadding() const override;
27 bool ShouldShowWindowIcon() const override;
25 bool IsHarmonyMode() const override; 28 bool IsHarmonyMode() const override;
26 int GetDialogPreferredWidth(DialogWidth width) const override; 29 int GetDialogPreferredWidth(DialogWidth width) const override;
27 bool ShouldShowWindowIcon() const override;
28 30
29 private: 31 private:
30 DISALLOW_COPY_AND_ASSIGN(HarmonyLayoutDelegate); 32 DISALLOW_COPY_AND_ASSIGN(HarmonyLayoutDelegate);
31 }; 33 };
32 34
33 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_ 35 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698