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

Side by Side 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, 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/ui/sync/browser_synced_window_delegates_getter.h"
6
7 #include "chrome/browser/sync/glue/synced_window_delegate.h"
8 #include "chrome/browser/ui/browser_finder.h"
9 #include "chrome/browser/ui/browser_iterator.h"
10 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h"
11
12 namespace browser_sync {
13
14 BrowserSyncedWindowDelegatesGetter::BrowserSyncedWindowDelegatesGetter() {}
15
16 std::set<const SyncedWindowDelegate*>
17 BrowserSyncedWindowDelegatesGetter::GetSyncedWindowDelegates() {
18 std::set<const SyncedWindowDelegate*> synced_window_delegates;
19 // Add all the browser windows.
20 for (chrome::BrowserIterator it; !it.done(); it.Next())
21 synced_window_delegates.insert(it->synced_window_delegate());
22 return synced_window_delegates;
23 }
24
25 const SyncedWindowDelegate* BrowserSyncedWindowDelegatesGetter::FindById(
26 SessionID::id_type id) {
27 Browser* browser = chrome::FindBrowserWithID(id);
28 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
29 }
30
31 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698