OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/sync/ios_chrome_synced_tab_delegate.h" | 5 #include "ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "components/sessions/ios/ios_serialized_navigation_builder.h" | 8 #include "components/sessions/ios/ios_serialized_navigation_builder.h" |
9 #include "components/sync_sessions/sync_sessions_client.h" | 9 #include "components/sync_sessions/sync_sessions_client.h" |
10 #include "components/sync_sessions/synced_window_delegate.h" | 10 #include "components/sync_sessions/synced_window_delegate.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 } | 45 } |
46 | 46 |
47 SessionID::id_type IOSChromeSyncedTabDelegate::GetSessionId() const { | 47 SessionID::id_type IOSChromeSyncedTabDelegate::GetSessionId() const { |
48 return IOSChromeSessionTabHelper::FromWebState(web_state_)->session_id().id(); | 48 return IOSChromeSessionTabHelper::FromWebState(web_state_)->session_id().id(); |
49 } | 49 } |
50 | 50 |
51 bool IOSChromeSyncedTabDelegate::IsBeingDestroyed() const { | 51 bool IOSChromeSyncedTabDelegate::IsBeingDestroyed() const { |
52 return web_state_->IsBeingDestroyed(); | 52 return web_state_->IsBeingDestroyed(); |
53 } | 53 } |
54 | 54 |
55 // todo(pnoland): add logic to store and return the source tab id on ios. | |
Nicolas Zea
2017/03/20 18:14:50
reference crbug?
Patrick Noland
2017/03/21 22:54:31
Done.
| |
56 SessionID::id_type IOSChromeSyncedTabDelegate::GetSourceTabID() const { | |
57 return sync_sessions::kInvalidTabID; | |
58 } | |
59 | |
55 std::string IOSChromeSyncedTabDelegate::GetExtensionAppId() const { | 60 std::string IOSChromeSyncedTabDelegate::GetExtensionAppId() const { |
56 return std::string(); | 61 return std::string(); |
57 } | 62 } |
58 | 63 |
59 bool IOSChromeSyncedTabDelegate::IsInitialBlankNavigation() const { | 64 bool IOSChromeSyncedTabDelegate::IsInitialBlankNavigation() const { |
60 return web_state_->GetNavigationManager()->GetItemCount() == 0; | 65 return web_state_->GetNavigationManager()->GetItemCount() == 0; |
61 } | 66 } |
62 | 67 |
63 int IOSChromeSyncedTabDelegate::GetCurrentEntryIndex() const { | 68 int IOSChromeSyncedTabDelegate::GetCurrentEntryIndex() const { |
64 return web_state_->GetNavigationManager()->GetCurrentItemIndex(); | 69 return web_state_->GetNavigationManager()->GetCurrentItemIndex(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 for (int i = 0; i < entry_count; ++i) { | 132 for (int i = 0; i < entry_count; ++i) { |
128 const GURL& virtual_url = GetVirtualURLAtIndex(i); | 133 const GURL& virtual_url = GetVirtualURLAtIndex(i); |
129 if (!virtual_url.is_valid()) | 134 if (!virtual_url.is_valid()) |
130 continue; | 135 continue; |
131 | 136 |
132 if (sessions_client->ShouldSyncURL(virtual_url)) | 137 if (sessions_client->ShouldSyncURL(virtual_url)) |
133 return true; | 138 return true; |
134 } | 139 } |
135 return false; | 140 return false; |
136 } | 141 } |
OLD | NEW |