Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "ios/chrome/browser/ui/activity_services/share_to_data_builder.h" | 5 #include "ios/chrome/browser/ui/activity_services/share_to_data_builder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ios/chrome/browser/tabs/tab.h" | 8 #include "ios/chrome/browser/tabs/tab.h" |
| 9 #include "ios/chrome/browser/ui/activity_services/chrome_activity_item_thumbnail _generator.h" | 9 #include "ios/chrome/browser/ui/activity_services/chrome_activity_item_thumbnail _generator.h" |
| 10 #include "ios/chrome/browser/ui/activity_services/share_to_data.h" | 10 #include "ios/chrome/browser/ui/activity_services/share_to_data.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 if (!tab.webState) | 24 if (!tab.webState) |
| 25 return nil; | 25 return nil; |
| 26 DCHECK(tab); | 26 DCHECK(tab); |
| 27 // If the original page title exists, it is expected to match the tab title. | 27 // If the original page title exists, it is expected to match the tab title. |
| 28 // If this ever changes, then a decision has to be made on which one should | 28 // If this ever changes, then a decision has to be made on which one should |
| 29 // be used for sharing. | 29 // be used for sharing. |
| 30 DCHECK(!tab.originalTitle || [tab.originalTitle isEqualToString:tab.title]); | 30 DCHECK(!tab.originalTitle || [tab.originalTitle isEqualToString:tab.title]); |
| 31 BOOL isPagePrintable = [tab viewForPrinting] != nil; | 31 BOOL isPagePrintable = [tab viewForPrinting] != nil; |
| 32 ThumbnailGeneratorBlock thumbnailGenerator = | 32 ThumbnailGeneratorBlock thumbnailGenerator = |
| 33 activity_services::ThumbnailGeneratorForTab(tab); | 33 activity_services::ThumbnailGeneratorForTab(tab); |
| 34 return [[ShareToData alloc] initWithURL:tab.url | 34 return [[ShareToData alloc] initWithURL:tab.lastCommittedURL |
|
kkhorimoto
2017/04/14 20:35:24
If a user is attempting to share a page, we can as
sdefresne
2017/04/18 15:56:49
I personally frequently share pages that are still
Eugene But (OOO till 7-30)
2017/04/18 16:16:47
I think we should be consistent with other feature
kkhorimoto
2017/05/31 22:12:36
I agree with Eugene that it should be last committ
kkhorimoto
2017/06/01 19:52:23
Changed to visible per discussion on email thread.
| |
| 35 title:tab.title | 35 title:tab.title |
| 36 isOriginalTitle:(tab.originalTitle != nil) | 36 isOriginalTitle:(tab.originalTitle != nil) |
| 37 isPagePrintable:isPagePrintable | 37 isPagePrintable:isPagePrintable |
| 38 thumbnailGenerator:thumbnailGenerator]; | 38 thumbnailGenerator:thumbnailGenerator]; |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace activity_services | 41 } // namespace activity_services |
| OLD | NEW |