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

Unified Diff: chrome/browser/ui/views/harmony/harmony_views_layout_delegate.h

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Deleted LayoutDelegate and HarmonyLayoutDelegate. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/harmony/harmony_views_layout_delegate.h
diff --git a/chrome/browser/ui/views/harmony/harmony_views_layout_delegate.h b/chrome/browser/ui/views/harmony/harmony_views_layout_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..150d662ea62d93f3f41e57ae1d97724f174c478d
--- /dev/null
+++ b/chrome/browser/ui/views/harmony/harmony_views_layout_delegate.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_VIEWS_LAYOUT_DELEGATE_H_
+#define CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_VIEWS_LAYOUT_DELEGATE_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "chrome/browser/ui/views/harmony/chrome_views_layout_delegate.h"
+#include "ui/gfx/geometry/insets.h"
+#include "ui/views/layout/grid_layout.h"
+
+class HarmonyViewsLayoutDelegate : public ChromeViewsLayoutDelegate {
+ public:
+ // The Harmony layout unit. All distances are in terms of this unit.
+ static constexpr int kHarmonyLayoutUnit = 16;
+
+ HarmonyViewsLayoutDelegate() {}
+ ~HarmonyViewsLayoutDelegate() override {}
+
+ gfx::Insets GetInsetsMetric(ChromeInsetsMetric metric) const override;
+ int GetDistanceMetric(ChromeDistanceMetric metric) const override;
+ views::GridLayout::Alignment GetControlLabelGridAlignment() const override;
+ bool UseExtraDialogPadding() const override;
+ bool ShouldShowWindowIcon() const override;
+ bool IsHarmonyMode() const override;
+ int GetDialogPreferredWidth(DialogWidth width) const override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HarmonyViewsLayoutDelegate);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_VIEWS_LAYOUT_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698