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

Side by Side Diff: chrome/browser/sync/glue/synced_window_delegate_android.cc

Issue 15499005: Add a new SyncedTabDelegate for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit. Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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/sync/glue/synced_tab_delegate_android.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/sessions/session_id.h"
12 #include "content/public/browser/web_contents.h" 11 #include "content/public/browser/web_contents.h"
13 12
14 namespace browser_sync { 13 namespace browser_sync {
15 14
16 // SyncedWindowDelegate implementations 15 // SyncedWindowDelegate implementations
17 16
18 const std::set<SyncedWindowDelegate*> 17 const std::set<SyncedWindowDelegate*>
19 SyncedWindowDelegate::GetSyncedWindowDelegates() { 18 SyncedWindowDelegate::GetSyncedWindowDelegates() {
20 std::set<SyncedWindowDelegate*> synced_window_delegates; 19 std::set<SyncedWindowDelegate*> synced_window_delegates;
21 for (TabModelList::const_iterator i = TabModelList::begin(); 20 for (TabModelList::const_iterator i = TabModelList::begin();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool SyncedWindowDelegateAndroid::IsTypePopup() const { 69 bool SyncedWindowDelegateAndroid::IsTypePopup() const {
71 return false; 70 return false;
72 } 71 }
73 72
74 bool SyncedWindowDelegateAndroid::IsTabPinned( 73 bool SyncedWindowDelegateAndroid::IsTabPinned(
75 const SyncedTabDelegate* tab) const { 74 const SyncedTabDelegate* tab) const {
76 return false; 75 return false;
77 } 76 }
78 77
79 SyncedTabDelegate* SyncedWindowDelegateAndroid::GetTabAt(int index) const { 78 SyncedTabDelegate* SyncedWindowDelegateAndroid::GetTabAt(int index) const {
80 content::WebContents* web_contents = tab_model_->GetWebContentsAt(index); 79 return tab_model_->GetTabAt(index);
81 return web_contents ? TabContentsSyncedTabDelegate::FromWebContents(
82 web_contents) : NULL;
83 } 80 }
84 81
85 SessionID::id_type SyncedWindowDelegateAndroid::GetTabIdAt(int index) const { 82 SessionID::id_type SyncedWindowDelegateAndroid::GetTabIdAt(int index) const {
86 return tab_model_->GetTabIdAt(index); 83 return GetTabAt(index)->GetSessionId();
87 } 84 }
88 85
89 bool SyncedWindowDelegateAndroid::IsSessionRestoreInProgress() const { 86 bool SyncedWindowDelegateAndroid::IsSessionRestoreInProgress() const {
90 return tab_model_->IsSessionRestoreInProgress(); 87 return tab_model_->IsSessionRestoreInProgress();
91 } 88 }
92 89
93 } // namespace browser_sync 90 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698