| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_API_SESSIONS_SESSIONS_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SESSIONS_SESSIONS_API_H__ | 
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SESSIONS_SESSIONS_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SESSIONS_SESSIONS_API_H__ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "base/macros.h" | 10 #include "base/macros.h" | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
| 29 | 29 | 
| 30 class SessionsGetRecentlyClosedFunction : public ChromeSyncExtensionFunction { | 30 class SessionsGetRecentlyClosedFunction : public ChromeSyncExtensionFunction { | 
| 31  protected: | 31  protected: | 
| 32   ~SessionsGetRecentlyClosedFunction() override {} | 32   ~SessionsGetRecentlyClosedFunction() override {} | 
| 33   bool RunSync() override; | 33   bool RunSync() override; | 
| 34   DECLARE_EXTENSION_FUNCTION("sessions.getRecentlyClosed", | 34   DECLARE_EXTENSION_FUNCTION("sessions.getRecentlyClosed", | 
| 35                              SESSIONS_GETRECENTLYCLOSED) | 35                              SESSIONS_GETRECENTLYCLOSED) | 
| 36 | 36 | 
| 37  private: | 37  private: | 
| 38   api::tabs::Tab CreateTabModel(const sessions::TabRestoreService::Tab& tab, | 38   api::tabs::Tab CreateTabModel(const sessions::TabRestoreService::Tab& tab, | 
| 39                                 int session_id, | 39                                 bool active); | 
| 40                                 int selected_index); |  | 
| 41   std::unique_ptr<api::windows::Window> CreateWindowModel( | 40   std::unique_ptr<api::windows::Window> CreateWindowModel( | 
| 42       const sessions::TabRestoreService::Window& window, | 41       const sessions::TabRestoreService::Window& window); | 
| 43       int session_id); |  | 
| 44   std::unique_ptr<api::sessions::Session> CreateSessionModel( | 42   std::unique_ptr<api::sessions::Session> CreateSessionModel( | 
| 45       const sessions::TabRestoreService::Entry* entry); | 43       const sessions::TabRestoreService::Entry& entry); | 
| 46 }; | 44 }; | 
| 47 | 45 | 
| 48 class SessionsGetDevicesFunction : public ChromeSyncExtensionFunction { | 46 class SessionsGetDevicesFunction : public ChromeSyncExtensionFunction { | 
| 49  protected: | 47  protected: | 
| 50   ~SessionsGetDevicesFunction() override {} | 48   ~SessionsGetDevicesFunction() override {} | 
| 51   bool RunSync() override; | 49   bool RunSync() override; | 
| 52   DECLARE_EXTENSION_FUNCTION("sessions.getDevices", SESSIONS_GETDEVICES) | 50   DECLARE_EXTENSION_FUNCTION("sessions.getDevices", SESSIONS_GETDEVICES) | 
| 53 | 51 | 
| 54  private: | 52  private: | 
| 55   api::tabs::Tab CreateTabModel(const std::string& session_tag, | 53   api::tabs::Tab CreateTabModel(const std::string& session_tag, | 
| 56                                 const sessions::SessionTab& tab, | 54                                 const sessions::SessionTab& tab, | 
| 57                                 int tab_index, | 55                                 int tab_index, | 
| 58                                 int selected_index); | 56                                 bool active); | 
| 59   std::unique_ptr<api::windows::Window> CreateWindowModel( | 57   std::unique_ptr<api::windows::Window> CreateWindowModel( | 
| 60       const sessions::SessionWindow& window, | 58       const sessions::SessionWindow& window, | 
| 61       const std::string& session_tag); | 59       const std::string& session_tag); | 
| 62   std::unique_ptr<api::sessions::Session> CreateSessionModel( | 60   std::unique_ptr<api::sessions::Session> CreateSessionModel( | 
| 63       const sessions::SessionWindow& window, | 61       const sessions::SessionWindow& window, | 
| 64       const std::string& session_tag); | 62       const std::string& session_tag); | 
| 65   api::sessions::Device CreateDeviceModel( | 63   api::sessions::Device CreateDeviceModel( | 
| 66       const sync_driver::SyncedSession* session); | 64       const sync_driver::SyncedSession* session); | 
| 67 }; | 65 }; | 
| 68 | 66 | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 134 | 132 | 
| 135   // Created lazily upon OnListenerAdded. | 133   // Created lazily upon OnListenerAdded. | 
| 136   std::unique_ptr<SessionsEventRouter> sessions_event_router_; | 134   std::unique_ptr<SessionsEventRouter> sessions_event_router_; | 
| 137 | 135 | 
| 138   DISALLOW_COPY_AND_ASSIGN(SessionsAPI); | 136   DISALLOW_COPY_AND_ASSIGN(SessionsAPI); | 
| 139 }; | 137 }; | 
| 140 | 138 | 
| 141 }  // namespace extensions | 139 }  // namespace extensions | 
| 142 | 140 | 
| 143 #endif  // CHROME_BROWSER_EXTENSIONS_API_SESSIONS_SESSIONS_API_H__ | 141 #endif  // CHROME_BROWSER_EXTENSIONS_API_SESSIONS_SESSIONS_API_H__ | 
| OLD | NEW | 
|---|