| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Returns a pointer to the current session model associator or NULL. | 59 // Returns a pointer to the current session model associator or NULL. |
| 60 static sync_sessions::OpenTabsUIDelegate* GetOpenTabsUIDelegate( | 60 static sync_sessions::OpenTabsUIDelegate* GetOpenTabsUIDelegate( |
| 61 content::WebUI* web_ui); | 61 content::WebUI* web_ui); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // syncer::SyncServiceObserver: | 64 // syncer::SyncServiceObserver: |
| 65 void OnStateChanged() override {} | 65 void OnStateChanged() override {} |
| 66 void OnSyncConfigurationCompleted() override; | 66 void OnSyncConfigurationCompleted() override; |
| 67 void OnForeignSessionUpdated() override; | 67 void OnForeignSessionUpdated() override; |
| 68 | 68 |
| 69 // Returns true if tab sync is enabled for this profile, otherwise false. | |
| 70 bool IsTabSyncEnabled(); | |
| 71 | |
| 72 // Returns a string used to show the user when a session was last modified. | 69 // Returns a string used to show the user when a session was last modified. |
| 73 base::string16 FormatSessionTime(const base::Time& time); | 70 base::string16 FormatSessionTime(const base::Time& time); |
| 74 | 71 |
| 75 // Determines which session is to be opened, and then calls | 72 // Determines which session is to be opened, and then calls |
| 76 // OpenForeignSession, to begin the process of opening a new browser window. | 73 // OpenForeignSession, to begin the process of opening a new browser window. |
| 77 // This is a javascript callback handler. | 74 // This is a javascript callback handler. |
| 78 void HandleOpenForeignSession(const base::ListValue* args); | 75 void HandleOpenForeignSession(const base::ListValue* args); |
| 79 | 76 |
| 80 // Determines whether foreign sessions should be obtained from the sync model. | 77 // Determines whether foreign sessions should be obtained from the sync model. |
| 81 // This is a javascript callback handler, and it is also called when the sync | 78 // This is a javascript callback handler, and it is also called when the sync |
| (...skipping 15 matching lines...) Expand all Loading... |
| 97 // The time at which this WebUI was created. Used to calculate how long | 94 // The time at which this WebUI was created. Used to calculate how long |
| 98 // the WebUI was present before the sessions data was visible. | 95 // the WebUI was present before the sessions data was visible. |
| 99 base::TimeTicks load_attempt_time_; | 96 base::TimeTicks load_attempt_time_; |
| 100 | 97 |
| 101 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); | 98 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); |
| 102 }; | 99 }; |
| 103 | 100 |
| 104 } // namespace browser_sync | 101 } // namespace browser_sync |
| 105 | 102 |
| 106 #endif // CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ | 103 #endif // CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ |
| OLD | NEW |