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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/synced_window_delegates_getter_android.cc
diff --git a/chrome/browser/sync/glue/synced_window_delegates_getter_android.cc b/chrome/browser/sync/glue/synced_window_delegates_getter_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..31d22ebd2009a221bba09189ff096db81a77f371
--- /dev/null
+++ b/chrome/browser/sync/glue/synced_window_delegates_getter_android.cc
@@ -0,0 +1,33 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h"
+
+#include "chrome/browser/sync/glue/synced_window_delegate.h"
+#include "chrome/browser/ui/android/tab_model/tab_model.h"
+#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
+
+namespace browser_sync {
+
+SyncedWindowDelegatesGetterAndroid::SyncedWindowDelegatesGetterAndroid() {}
+SyncedWindowDelegatesGetterAndroid::~SyncedWindowDelegatesGetterAndroid() {}
+
+std::set<const SyncedWindowDelegate*>
+SyncedWindowDelegatesGetterAndroid::GetSyncedWindowDelegates() {
+ std::set<SyncedWindowDelegate const*> synced_window_delegates;
+ for (auto i = TabModelList::begin(); i != TabModelList::end(); ++i) {
+ synced_window_delegates.insert((*i)->GetSyncedWindowDelegate());
+ }
+ return synced_window_delegates;
+}
+
+const SyncedWindowDelegate* SyncedWindowDelegatesGetterAndroid::FindById(
+ SessionID::id_type session_id) {
+ TabModel* tab_model = TabModelList::FindTabModelWithId(session_id);
+
+ // In case we don't find the browser (e.g. for Developer Tools).
+ return tab_model ? tab_model->GetSyncedWindowDelegate() : nullptr;
+}
+
+} // namespace browser_sync
« 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