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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 static void OpenForeignSessionWindows(content::WebUI* web_ui, | 50 static void OpenForeignSessionWindows(content::WebUI* web_ui, |
51 const std::string& session_string_value, | 51 const std::string& session_string_value, |
52 SessionID::id_type window_num); | 52 SessionID::id_type window_num); |
53 | 53 |
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 OnSyncConfigurationCompleted(syncer::SyncService* sync) override; |
61 void OnSyncConfigurationCompleted() override; | 61 void OnForeignSessionUpdated(syncer::SyncService* sync) override; |
62 void OnForeignSessionUpdated() override; | |
63 | 62 |
64 // Returns a string used to show the user when a session was last modified. | 63 // Returns a string used to show the user when a session was last modified. |
65 base::string16 FormatSessionTime(const base::Time& time); | 64 base::string16 FormatSessionTime(const base::Time& time); |
66 | 65 |
67 // Determines which session is to be opened, and then calls | 66 // Determines which session is to be opened, and then calls |
68 // OpenForeignSession, to begin the process of opening a new browser window. | 67 // OpenForeignSession, to begin the process of opening a new browser window. |
69 // This is a javascript callback handler. | 68 // This is a javascript callback handler. |
70 void HandleOpenForeignSession(const base::ListValue* args); | 69 void HandleOpenForeignSession(const base::ListValue* args); |
71 | 70 |
72 // Determines whether foreign sessions should be obtained from the sync model. | 71 // Determines whether foreign sessions should be obtained from the sync model. |
(...skipping 16 matching lines...) Expand all Loading... |
89 // The time at which this WebUI was created. Used to calculate how long | 88 // The time at which this WebUI was created. Used to calculate how long |
90 // the WebUI was present before the sessions data was visible. | 89 // the WebUI was present before the sessions data was visible. |
91 base::TimeTicks load_attempt_time_; | 90 base::TimeTicks load_attempt_time_; |
92 | 91 |
93 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); | 92 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); |
94 }; | 93 }; |
95 | 94 |
96 } // namespace browser_sync | 95 } // namespace browser_sync |
97 | 96 |
98 #endif // CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ | 97 #endif // CHROME_BROWSER_UI_WEBUI_FOREIGN_SESSION_HANDLER_H_ |
OLD | NEW |