| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "components/sessions/session_id.h" | 10 #include "components/sessions/session_id.h" |
| 11 | 11 |
| 12 namespace browser_sync { | 12 namespace browser_sync { |
| 13 | 13 |
| 14 class SyncedTabDelegate; | 14 class SyncedTabDelegate; |
| 15 | 15 |
| 16 // A SyncedWindowDelegate is used to insulate the sync code from depending | 16 // A SyncedWindowDelegate is used to insulate the sync code from depending |
| 17 // directly on Browser and BrowserList. | 17 // directly on Browser and BrowserList. |
| 18 class SyncedWindowDelegate { | 18 class SyncedWindowDelegate { |
| 19 public: | 19 public: |
| 20 // Methods originating from WindowList | |
| 21 | |
| 22 // Returns all SyncedWindowDelegate instances. | |
| 23 static std::set<const SyncedWindowDelegate*> GetAll(); | |
| 24 | |
| 25 // Find a SyncedWindowDelegate given its window's id. | |
| 26 static const SyncedWindowDelegate* FindById(SessionID::id_type id); | |
| 27 | |
| 28 // Methods originating from Browser. | 20 // Methods originating from Browser. |
| 29 | 21 |
| 30 // Returns true iff this browser has a visible window representation | 22 // Returns true iff this browser has a visible window representation |
| 31 // associated with it. Sometimes, if a window is being created/removed the | 23 // associated with it. Sometimes, if a window is being created/removed the |
| 32 // model object may exist without its UI counterpart. | 24 // model object may exist without its UI counterpart. |
| 33 virtual bool HasWindow() const = 0; | 25 virtual bool HasWindow() const = 0; |
| 34 | 26 |
| 35 // see Browser::session_id | 27 // see Browser::session_id |
| 36 virtual SessionID::id_type GetSessionId() const = 0; | 28 virtual SessionID::id_type GetSessionId() const = 0; |
| 37 | 29 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Return true if this window should be considered for syncing. | 61 // Return true if this window should be considered for syncing. |
| 70 virtual bool ShouldSync() const = 0; | 62 virtual bool ShouldSync() const = 0; |
| 71 | 63 |
| 72 protected: | 64 protected: |
| 73 virtual ~SyncedWindowDelegate() {} | 65 virtual ~SyncedWindowDelegate() {} |
| 74 }; | 66 }; |
| 75 | 67 |
| 76 } // namespace browser_sync | 68 } // namespace browser_sync |
| 77 | 69 |
| 78 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_ | 70 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_ |
| OLD | NEW |