OLD | NEW |
---|---|
(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 | |
OLD | NEW |