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

Unified Diff: ios/chrome/browser/ui/ntp/recent_tabs/views/signed_in_sync_on_no_sessions_view.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/signed_in_sync_on_no_sessions_view.mm
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/views/signed_in_sync_on_no_sessions_view.mm b/ios/chrome/browser/ui/ntp/recent_tabs/views/signed_in_sync_on_no_sessions_view.mm
new file mode 100644
index 0000000000000000000000000000000000000000..8f67e58a90bf44878c92049eb7163c8966a15588
--- /dev/null
+++ b/ios/chrome/browser/ui/ntp/recent_tabs/views/signed_in_sync_on_no_sessions_view.mm
@@ -0,0 +1,50 @@
+// 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/signed_in_sync_on_no_sessions_view.h"
+
+#include "base/logging.h"
+#import "ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h"
+#include "ios/chrome/browser/ui/rtl_geometry.h"
+#import "ios/chrome/browser/ui/uikit_ui_util.h"
+#include "ios/chrome/grit/ios_chromium_strings.h"
+#include "ios/chrome/grit/ios_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+// Desired height of the view.
+const CGFloat kDesiredHeight = 130;
+
+} // anonymous namespace
+
+@implementation SignedInSyncOnNoSessionsView
+
+- (instancetype)initWithFrame:(CGRect)aRect {
+ self = [super initWithFrame:CGRectZero];
+ if (self) {
+ // Create and add the label.
+ UILabel* noSessionLabel = recent_tabs::CreateMultilineLabel(
+ l10n_util::GetNSString(IDS_IOS_OPEN_TABS_NO_SESSION_INSTRUCTIONS));
+ [self addSubview:noSessionLabel];
+
+ // Set constraints on the label.
+ NSDictionary* viewsDictionary = @{ @"label" : noSessionLabel };
+ NSArray* constraints =
+ @[ @"V:|-16-[label]-(>=16)-|", @"H:|-16-[label]-16-|" ];
+ ApplyVisualConstraintsWithOptions(constraints, viewsDictionary,
+ LayoutOptionForRTLSupport(), self);
+ }
+ return self;
+}
+
++ (CGFloat)desiredHeightInUITableViewCell {
+ return kDesiredHeight;
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698