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

Unified Diff: ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm

Issue 2589803002: Upstream Chrome on iOS source code [6/11]. (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
Index: ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm b/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm
new file mode 100644
index 0000000000000000000000000000000000000000..4cfd7d926f614da4df4586b6abeb08c9b3e7e5a5
--- /dev/null
+++ b/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm
@@ -0,0 +1,70 @@
+// Copyright 2014 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.
+
+#import "ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h"
+
+#include "base/logging.h"
+#import "ios/chrome/browser/ui/uikit_ui_util.h"
+#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+// Text color.
+const int kTextColorBlue = 0x4285f4;
+const int kTextColorGray = 0x333333;
+
+// Subtitle text color.
+const int kSubtitleColorBlue = 0x7daeff;
+const int kSubtitleColorGray = 0x969696;
+
+// Colors for the icons.
+const int kIconColorBlue = 0x4285f4;
+const int kIconColorGray = 0x5a5a5a;
+
+} // namespace
+
+namespace recent_tabs {
+
+UILabel* CreateMultilineLabel(NSString* text) {
+ UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero];
+ [label setTranslatesAutoresizingMaskIntoConstraints:NO];
+ [label setText:text];
+ [label setLineBreakMode:NSLineBreakByWordWrapping];
+ [label setNumberOfLines:0];
+ [label setFont:[MDCTypography body1Font]];
+ [label setTextColor:UIColorFromRGB(kTextColorGray)];
+ [label setTextAlignment:NSTextAlignmentNatural];
+ [label setBackgroundColor:[UIColor whiteColor]];
+ return label;
+}
+
+UIColor* GetTextColorBlue() {
+ return UIColorFromRGB(kTextColorBlue);
+}
+
+UIColor* GetTextColorGray() {
+ return UIColorFromRGB(kTextColorGray);
+}
+
+UIColor* GetSubtitleColorBlue() {
+ return UIColorFromRGB(kSubtitleColorBlue);
+}
+
+UIColor* GetSubtitleColorGray() {
+ return UIColorFromRGB(kSubtitleColorGray);
+}
+
+UIColor* GetIconColorBlue() {
+ return UIColorFromRGB(kIconColorBlue);
+}
+
+UIColor* GetIconColorGray() {
+ return UIColorFromRGB(kIconColorGray);
+}
+
+} // namespace recent_tabs
« no previous file with comments | « ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h ('k') | ios/chrome/browser/ui/ntp/whats_new_header_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698