| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/sync/glue/synced_window_delegate_android.h" | 5 #include "chrome/browser/sync/glue/synced_window_delegate_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/sessions/session_id.h" |
| 8 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 9 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
| 9 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | 10 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
| 10 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 11 #include "chrome/browser/ui/sync/synced_tab_delegate_android.h" |
| 11 #include "chrome/browser/sessions/session_id.h" | |
| 12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 13 | 13 |
| 14 namespace browser_sync { | 14 namespace browser_sync { |
| 15 | 15 |
| 16 // SyncedWindowDelegate implementations | 16 // SyncedWindowDelegate implementations |
| 17 | 17 |
| 18 const std::set<SyncedWindowDelegate*> | 18 const std::set<SyncedWindowDelegate*> |
| 19 SyncedWindowDelegate::GetSyncedWindowDelegates() { | 19 SyncedWindowDelegate::GetSyncedWindowDelegates() { |
| 20 std::set<SyncedWindowDelegate*> synced_window_delegates; | 20 std::set<SyncedWindowDelegate*> synced_window_delegates; |
| 21 for (TabModelList::const_iterator i = TabModelList::begin(); | 21 for (TabModelList::const_iterator i = TabModelList::begin(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool SyncedWindowDelegateAndroid::IsTypePopup() const { | 70 bool SyncedWindowDelegateAndroid::IsTypePopup() const { |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool SyncedWindowDelegateAndroid::IsTabPinned( | 74 bool SyncedWindowDelegateAndroid::IsTabPinned( |
| 75 const SyncedTabDelegate* tab) const { | 75 const SyncedTabDelegate* tab) const { |
| 76 return false; | 76 return false; |
| 77 } | 77 } |
| 78 | 78 |
| 79 SyncedTabDelegate* SyncedWindowDelegateAndroid::GetTabAt(int index) const { | 79 SyncedTabDelegate* SyncedWindowDelegateAndroid::GetTabAt(int index) const { |
| 80 content::WebContents* web_contents = tab_model_->GetWebContentsAt(index); | 80 return tab_model_->GetTabAt(index); |
| 81 return web_contents ? TabContentsSyncedTabDelegate::FromWebContents( | |
| 82 web_contents) : NULL; | |
| 83 } | 81 } |
| 84 | 82 |
| 85 SessionID::id_type SyncedWindowDelegateAndroid::GetTabIdAt(int index) const { | 83 SessionID::id_type SyncedWindowDelegateAndroid::GetTabIdAt(int index) const { |
| 86 return tab_model_->GetTabIdAt(index); | 84 return tab_model_->GetTabAt(index)->GetSessionId().id(); |
| 87 } | 85 } |
| 88 | 86 |
| 89 bool SyncedWindowDelegateAndroid::IsSessionRestoreInProgress() const { | 87 bool SyncedWindowDelegateAndroid::IsSessionRestoreInProgress() const { |
| 90 return tab_model_->IsSessionRestoreInProgress(); | 88 return tab_model_->IsSessionRestoreInProgress(); |
| 91 } | 89 } |
| 92 | 90 |
| 93 } // namespace browser_sync | 91 } // namespace browser_sync |
| OLD | NEW |