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

Unified Diff: ui/harmony/harmony_layout_delegate.h

Issue 2485083003: views: add layout delegates (Closed)
Patch Set: Created 4 years, 1 month 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: ui/harmony/harmony_layout_delegate.h
diff --git a/ui/harmony/harmony_layout_delegate.h b/ui/harmony/harmony_layout_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..20f849c9df7ade7eeda40021068743b4f26d984a
--- /dev/null
+++ b/ui/harmony/harmony_layout_delegate.h
@@ -0,0 +1,33 @@
+// 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.
+
+#ifndef UI_HARMONY_HARMONY_LAYOUT_DELEGATE_H_
+#define UI_HARMONY_HARMONY_LAYOUT_DELEGATE_H_
+
+#include "ui/harmony/harmony_export.h"
+#include "ui/views/layout/layout_delegate.h"
+
+namespace views {
+class View;
+} // namespace views
+
+namespace ui {
+
+class HARMONY_EXPORT HarmonyLayoutDelegate : public views::LayoutDelegate {
sky 2016/11/08 23:34:00 We are in the process of trying to cleanup the ui
+ public:
+ // Returns the singleton HarmonyLayoutDelegate instance.
+ static HarmonyLayoutDelegate* Get();
+
+ // Convenience function: if Harmony mode is enabled, sets the
+ // HarmonyLayoutDelegate singleton instance to be |view|'s LayoutDelegate.
+ static void ApplyToViewIfNeeded(views::View* view);
+
+ // views::LayoutDelegate:
+ int GetLayoutDistance(LayoutDistanceType type) const override;
+ bool UseExtraDialogPadding() const override;
+};
+
+} // namespace ui
+
+#endif // UI_HARMONY_HARMONY_LAYOUT_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698