OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |