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

Unified Diff: ios/chrome/today_extension/ui_util.h

Issue 2586713002: Upstream code and resources for Chrome on iOS extensions. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « ios/chrome/today_extension/transparent_button.mm ('k') | ios/chrome/today_extension/ui_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/today_extension/ui_util.h
diff --git a/ios/chrome/today_extension/ui_util.h b/ios/chrome/today_extension/ui_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..5644e3b8edc615a06629d24ce23589a751755efe
--- /dev/null
+++ b/ios/chrome/today_extension/ui_util.h
@@ -0,0 +1,64 @@
+// Copyright 2015 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 IOS_CHROME_TODAY_EXTENSION_UI_UTIL_H_
+#define IOS_CHROME_TODAY_EXTENSION_UI_UTIL_H_
+
+namespace ui_util {
+
+// Inset for the widget.
+// This value is only used on iOS10 as the value passed to
+// |widgetMarginInsetsForProposedMarginInsets:| is used on previous versions.
+extern const CGFloat kDefaultLeadingMarginInset;
+
+// UI metrics to layout the Today extension.
+extern const CGFloat kFirstLineHeight;
+extern const CGFloat kFirstLineButtonMargin;
+extern const CGFloat kSecondLineHeight;
+extern const CGFloat kSecondLineVerticalPadding;
+extern const CGFloat kUIButtonSeparator;
+extern const CGFloat kUIButtonFrontShift;
+extern const CGFloat kUIButtonCornerRadius;
+
+extern const CGFloat kFooterVerticalMargin;
+extern const CGFloat kFooterHorizontalMargin;
+extern const CGFloat kTitleFontSize;
+
+extern const CGFloat kEmptyLabelYOffset;
+
+// Returns the color for the buttons.
+UIColor* TitleColor();
+UIColor* BorderColor();
+UIColor* InkColor();
+UIColor* TextColor();
+UIColor* BackgroundColor();
+
+UIColor* NormalTintColor();
+UIColor* ActiveTintColor();
+
+// Returns the color for footer text.
+UIColor* FooterTextColor();
+
+// Returns the color for empty widget label text.
+UIColor* emptyLabelColor();
+
+// Returns whether running on an iPad.
+bool IsIPadIdiom();
+
+// Returns whether the current language is right to left.
+bool IsRTL();
+
+// Returns the offset of Chrome icon in the title bar.
+CGFloat ChromeIconOffset();
+
+// Returns the offset of Chrome title in the title bar.
+CGFloat ChromeTextOffset();
+
+// Creates constraints so that |filler| fills entirely |container| and make them
+// active.
+void ConstrainAllSidesOfViewToView(UIView* container, UIView* filler);
+
+} // namespace ui_util
+
+#endif // IOS_CHROME_TODAY_EXTENSION_UI_UTIL_H_
« no previous file with comments | « ios/chrome/today_extension/transparent_button.mm ('k') | ios/chrome/today_extension/ui_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698