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

Side by Side Diff: ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.mm

Issue 2844253003: Adding close button in SigninPromoView (Closed)
Patch Set: Changing dismiss to close, and moving the button to the cell Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.h" 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_folder_collection_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "components/bookmarks/browser/bookmark_model.h" 9 #include "components/bookmarks/browser/bookmark_model.h"
10 #include "ios/chrome/browser/bookmarks/bookmarks_utils.h" 10 #include "ios/chrome/browser/bookmarks/bookmarks_utils.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 - (UICollectionViewCell*)cellAtIndexPath:(NSIndexPath*)indexPath { 407 - (UICollectionViewCell*)cellAtIndexPath:(NSIndexPath*)indexPath {
408 if (indexPath.section == self.promoSection) { 408 if (indexPath.section == self.promoSection) {
409 if (experimental_flags::IsSigninPromoEnabled()) { 409 if (experimental_flags::IsSigninPromoEnabled()) {
410 BookmarkSigninPromoCell* signinPromoCell = [self.collectionView 410 BookmarkSigninPromoCell* signinPromoCell = [self.collectionView
411 dequeueReusableCellWithReuseIdentifier:[BookmarkSigninPromoCell 411 dequeueReusableCellWithReuseIdentifier:[BookmarkSigninPromoCell
412 reuseIdentifier] 412 reuseIdentifier]
413 forIndexPath:indexPath]; 413 forIndexPath:indexPath];
414 signinPromoCell.signinPromoView.sendChromeCommand = YES; 414 signinPromoCell.signinPromoView.sendChromeCommand = YES;
415 [[_signinPromoViewMediator createConfigurator] 415 [[_signinPromoViewMediator createConfigurator]
416 configureSigninPromoView:signinPromoCell.signinPromoView]; 416 configureSigninPromoView:signinPromoCell.signinPromoView];
417 __weak BookmarkFolderCollectionView* weakSelf = self;
418 signinPromoCell.closeButtonAction = ^() {
419 [weakSelf.delegate bookmarkCollectionViewDismissPromo:self];
420 };
417 return signinPromoCell; 421 return signinPromoCell;
418 } else { 422 } else {
419 BookmarkPromoCell* promoCell = [self.collectionView 423 BookmarkPromoCell* promoCell = [self.collectionView
420 dequeueReusableCellWithReuseIdentifier:[BookmarkPromoCell 424 dequeueReusableCellWithReuseIdentifier:[BookmarkPromoCell
421 reuseIdentifier] 425 reuseIdentifier]
422 forIndexPath:indexPath]; 426 forIndexPath:indexPath];
423 promoCell.delegate = self; 427 promoCell.delegate = self;
424 return promoCell; 428 return promoCell;
425 } 429 }
426 } 430 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 [NSIndexPath indexPathForRow:0 inSection:self.promoSection]; 552 [NSIndexPath indexPathForRow:0 inSection:self.promoSection];
549 BookmarkSigninPromoCell* signinPromoCell = 553 BookmarkSigninPromoCell* signinPromoCell =
550 static_cast<BookmarkSigninPromoCell*>( 554 static_cast<BookmarkSigninPromoCell*>(
551 [self.collectionView cellForItemAtIndexPath:indexPath]); 555 [self.collectionView cellForItemAtIndexPath:indexPath]);
552 if (!signinPromoCell) 556 if (!signinPromoCell)
553 return; 557 return;
554 [configurator configureSigninPromoView:signinPromoCell.signinPromoView]; 558 [configurator configureSigninPromoView:signinPromoCell.signinPromoView];
555 } 559 }
556 560
557 @end 561 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698