| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 SessionID::id_type window_num); | 51 SessionID::id_type window_num); |
| 52 | 52 |
| 53 // Helper method to create JSON compatible objects from Session objects. | 53 // Helper method to create JSON compatible objects from Session objects. |
| 54 static bool SessionTabToValue(const ::sessions::SessionTab& tab, | 54 static bool SessionTabToValue(const ::sessions::SessionTab& tab, |
| 55 base::DictionaryValue* dictionary); | 55 base::DictionaryValue* dictionary); |
| 56 | 56 |
| 57 // Returns a pointer to the current session model associator or NULL. | 57 // Returns a pointer to the current session model associator or NULL. |
| 58 static OpenTabsUIDelegate* GetOpenTabsUIDelegate(content::WebUI* web_ui); | 58 static OpenTabsUIDelegate* GetOpenTabsUIDelegate(content::WebUI* web_ui); |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 // Used to register ForeignSessionHandler for notifications. | |
| 62 void Init(); | |
| 63 | |
| 64 // Determines how ForeignSessionHandler will interact with the new tab page. | 61 // Determines how ForeignSessionHandler will interact with the new tab page. |
| 65 void Observe(int type, | 62 void Observe(int type, |
| 66 const content::NotificationSource& source, | 63 const content::NotificationSource& source, |
| 67 const content::NotificationDetails& details) override; | 64 const content::NotificationDetails& details) override; |
| 68 | 65 |
| 69 // Returns true if tab sync is enabled for this profile, otherwise false. | 66 // Returns true if tab sync is enabled for this profile, otherwise false. |
| 70 bool IsTabSyncEnabled(); | 67 bool IsTabSyncEnabled(); |
| 71 | 68 |
| 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); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 96 | 93 |
| 97 // The Registrar used to register ForeignSessionHandler for notifications. | 94 // The Registrar used to register ForeignSessionHandler for notifications. |
| 98 content::NotificationRegistrar registrar_; | 95 content::NotificationRegistrar registrar_; |
| 99 | 96 |
| 100 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); | 97 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); |
| 101 }; | 98 }; |
| 102 | 99 |
| 103 } // namespace browser_sync | 100 } // namespace browser_sync |
| 104 | 101 |
| 105 #endif // CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ | 102 #endif // CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ |
| OLD | NEW |