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

Unified Diff: chrome/browser/ui/sync/browser_synced_window_delegates_getter.cc

Issue 1310373009: [Sync] Remove static methods on SyncedWindowDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android compile. Created 5 years, 4 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/ui/sync/browser_synced_window_delegates_getter.cc
diff --git a/chrome/browser/ui/sync/browser_synced_window_delegates_getter.cc b/chrome/browser/ui/sync/browser_synced_window_delegates_getter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4ea590e76152464c600d52c0367e044bb5f4acf3
--- /dev/null
+++ b/chrome/browser/ui/sync/browser_synced_window_delegates_getter.cc
@@ -0,0 +1,31 @@
+// 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/ui/sync/browser_synced_window_delegates_getter.h"
+
+#include "chrome/browser/sync/glue/synced_window_delegate.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_iterator.h"
+#include "chrome/browser/ui/sync/browser_synced_window_delegate.h"
+
+namespace browser_sync {
+
+BrowserSyncedWindowDelegatesGetter::BrowserSyncedWindowDelegatesGetter() {}
+
+std::set<const SyncedWindowDelegate*>
+BrowserSyncedWindowDelegatesGetter::GetSyncedWindowDelegates() {
+ std::set<const SyncedWindowDelegate*> synced_window_delegates;
+ // Add all the browser windows.
+ for (chrome::BrowserIterator it; !it.done(); it.Next())
+ synced_window_delegates.insert(it->synced_window_delegate());
+ return synced_window_delegates;
+}
+
+const SyncedWindowDelegate* BrowserSyncedWindowDelegatesGetter::FindById(
+ SessionID::id_type id) {
+ Browser* browser = chrome::FindBrowserWithID(id);
+ return (browser != NULL) ? browser->synced_window_delegate() : NULL;
Nicolas Zea 2015/08/31 22:12:47 nit: use nullptr (here and elsewhere in the CL). (
maxbogue 2015/09/01 17:29:28 I changed most, but not ones in files where NULL i
+}
+
+} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698