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.visibleURL |
|
rohitrao (ping after 24h)
2017/08/15 15:24:39
I was looking at this code today and it seems weir
Eugene But (OOO till 7-30)
2017/08/15 17:12:33
Good catch. tab.title will always be the title of
kkhorimoto (Do not use)
2017/08/15 17:53:16
Since we agreed that it's most likely that the use
| |
| 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 |