| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_NTP_FOREIGN_SESSION_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_FOREIGN_SESSION_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_FOREIGN_SESSION_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_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" |
| 11 #include "chrome/browser/sessions/session_service.h" | 11 #include "chrome/browser/sessions/session_service.h" |
| 12 #include "chrome/browser/sync/glue/session_model_associator.h" | 12 #include "chrome/browser/sync/open_tabs_ui_delegate.h" |
| 13 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 15 #include "content/public/browser/web_ui.h" | 15 #include "content/public/browser/web_ui.h" |
| 16 #include "content/public/browser/web_ui_message_handler.h" | 16 #include "content/public/browser/web_ui_message_handler.h" |
| 17 | 17 |
| 18 namespace user_prefs { | 18 namespace user_prefs { |
| 19 class PrefRegistrySyncable; | 19 class PrefRegistrySyncable; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace browser_sync { | 22 namespace browser_sync { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 | 43 |
| 44 static void OpenForeignSessionWindows(content::WebUI* web_ui, | 44 static void OpenForeignSessionWindows(content::WebUI* web_ui, |
| 45 const std::string& session_string_value, | 45 const std::string& session_string_value, |
| 46 SessionID::id_type window_num); | 46 SessionID::id_type window_num); |
| 47 | 47 |
| 48 // Helper method to create JSON compatible objects from Session objects. | 48 // Helper method to create JSON compatible objects from Session objects. |
| 49 static bool SessionTabToValue(const SessionTab& tab, | 49 static bool SessionTabToValue(const SessionTab& tab, |
| 50 DictionaryValue* dictionary); | 50 DictionaryValue* dictionary); |
| 51 | 51 |
| 52 // Returns a pointer to the current session model associator or NULL. | 52 // Returns a pointer to the current session model associator or NULL. |
| 53 static SessionModelAssociator* GetModelAssociator(content::WebUI* web_ui); | 53 static OpenTabsUIDelegate* GetOpenTabsUIDelegate(content::WebUI* web_ui); |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 // Used to register ForeignSessionHandler for notifications. | 56 // Used to register ForeignSessionHandler for notifications. |
| 57 void Init(); | 57 void Init(); |
| 58 | 58 |
| 59 // Determines how ForeignSessionHandler will interact with the new tab page. | 59 // Determines how ForeignSessionHandler will interact with the new tab page. |
| 60 virtual void Observe(int type, | 60 virtual void Observe(int type, |
| 61 const content::NotificationSource& source, | 61 const content::NotificationSource& source, |
| 62 const content::NotificationDetails& details) OVERRIDE; | 62 const content::NotificationDetails& details) OVERRIDE; |
| 63 | 63 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 91 | 91 |
| 92 // The Registrar used to register ForeignSessionHandler for notifications. | 92 // The Registrar used to register ForeignSessionHandler for notifications. |
| 93 content::NotificationRegistrar registrar_; | 93 content::NotificationRegistrar registrar_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); | 95 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace browser_sync | 98 } // namespace browser_sync |
| 99 | 99 |
| 100 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FOREIGN_SESSION_HANDLER_H_ | 100 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FOREIGN_SESSION_HANDLER_H_ |
| OLD | NEW |