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

Side by Side Diff: ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.mm

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)
Patch Set: use base:MakeUnique, alphabetize Created 3 years, 9 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
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
56 // http://crbug/695241
57 SessionID::id_type IOSChromeSyncedTabDelegate::GetSourceTabID() const {
58 return sync_sessions::kInvalidTabID;
59 }
60
55 std::string IOSChromeSyncedTabDelegate::GetExtensionAppId() const { 61 std::string IOSChromeSyncedTabDelegate::GetExtensionAppId() const {
56 return std::string(); 62 return std::string();
57 } 63 }
58 64
59 bool IOSChromeSyncedTabDelegate::IsInitialBlankNavigation() const { 65 bool IOSChromeSyncedTabDelegate::IsInitialBlankNavigation() const {
60 return web_state_->GetNavigationManager()->GetItemCount() == 0; 66 return web_state_->GetNavigationManager()->GetItemCount() == 0;
61 } 67 }
62 68
63 int IOSChromeSyncedTabDelegate::GetCurrentEntryIndex() const { 69 int IOSChromeSyncedTabDelegate::GetCurrentEntryIndex() const {
64 return web_state_->GetNavigationManager()->GetLastCommittedItemIndex(); 70 return web_state_->GetNavigationManager()->GetLastCommittedItemIndex();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 for (int i = 0; i < entry_count; ++i) { 133 for (int i = 0; i < entry_count; ++i) {
128 const GURL& virtual_url = GetVirtualURLAtIndex(i); 134 const GURL& virtual_url = GetVirtualURLAtIndex(i);
129 if (!virtual_url.is_valid()) 135 if (!virtual_url.is_valid())
130 continue; 136 continue;
131 137
132 if (sessions_client->ShouldSyncURL(virtual_url)) 138 if (sessions_client->ShouldSyncURL(virtual_url))
133 return true; 139 return true;
134 } 140 }
135 return false; 141 return false;
136 } 142 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698