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