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

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

Issue 1310373009: [Sync] Remove static methods on SyncedWindowDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
6
7 #include "chrome/browser/sync/glue/synced_window_delegate.h"
8 #include "chrome/browser/ui/android/tab_model/tab_model.h"
9 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
10
11 namespace browser_sync {
12
13 SyncedWindowDelegatesGetterAndroid::SyncedWindowDelegatesGetterAndroid() {}
14 SyncedWindowDelegatesGetterAndroid::~SyncedWindowDelegatesGetterAndroid() {}
15
16 std::set<const SyncedWindowDelegate*>
17 SyncedWindowDelegatesGetterAndroid::GetSyncedWindowDelegates() {
18 std::set<SyncedWindowDelegate const*> synced_window_delegates;
19 for (auto i = TabModelList::begin(); i != TabModelList::end(); ++i) {
20 synced_window_delegates.insert((*i)->GetSyncedWindowDelegate());
21 }
22 return synced_window_delegates;
23 }
24
25 const SyncedWindowDelegate* SyncedWindowDelegatesGetterAndroid::FindById(
26 SessionID::id_type session_id) {
27 TabModel* tab_model = TabModelList::FindTabModelWithId(session_id);
28
29 // In case we don't find the browser (e.g. for Developer Tools).
30 return tab_model ? tab_model->GetSyncedWindowDelegate() : nullptr;
31 }
32
33 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/synced_window_delegates_getter_android.h ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698