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.h" | 10 #include "base/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/glue/session_model_associator.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 class PrefServiceSyncable; |
| 19 |
18 namespace browser_sync { | 20 namespace browser_sync { |
19 | 21 |
20 class ForeignSessionHandler : public content::WebUIMessageHandler, | 22 class ForeignSessionHandler : public content::WebUIMessageHandler, |
21 public content::NotificationObserver { | 23 public content::NotificationObserver { |
22 public: | 24 public: |
23 // Invalid value, used to note that we don't have a tab or window number. | 25 // Invalid value, used to note that we don't have a tab or window number. |
24 static const int kInvalidId = -1; | 26 static const int kInvalidId = -1; |
25 | 27 |
26 // WebUIMessageHandler implementation. | 28 // WebUIMessageHandler implementation. |
27 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() OVERRIDE; |
28 | 30 |
29 ForeignSessionHandler(); | 31 ForeignSessionHandler(); |
30 virtual ~ForeignSessionHandler() {} | 32 virtual ~ForeignSessionHandler() {} |
31 | 33 |
32 static void RegisterUserPrefs(PrefService* prefs); | 34 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
33 | 35 |
34 static void OpenForeignSessionTab(content::WebUI* web_ui, | 36 static void OpenForeignSessionTab(content::WebUI* web_ui, |
35 const std::string& session_string_value, | 37 const std::string& session_string_value, |
36 SessionID::id_type window_num, | 38 SessionID::id_type window_num, |
37 SessionID::id_type tab_id, | 39 SessionID::id_type tab_id, |
38 const WindowOpenDisposition& disposition); | 40 const WindowOpenDisposition& disposition); |
39 | 41 |
40 static void OpenForeignSessionWindows(content::WebUI* web_ui, | 42 static void OpenForeignSessionWindows(content::WebUI* web_ui, |
41 const std::string& session_string_value, | 43 const std::string& session_string_value, |
42 SessionID::id_type window_num); | 44 SessionID::id_type window_num); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 93 |
92 // The Registrar used to register ForeignSessionHandler for notifications. | 94 // The Registrar used to register ForeignSessionHandler for notifications. |
93 content::NotificationRegistrar registrar_; | 95 content::NotificationRegistrar registrar_; |
94 | 96 |
95 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); | 97 DISALLOW_COPY_AND_ASSIGN(ForeignSessionHandler); |
96 }; | 98 }; |
97 | 99 |
98 } // namespace browser_sync | 100 } // namespace browser_sync |
99 | 101 |
100 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FOREIGN_SESSION_HANDLER_H_ | 102 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FOREIGN_SESSION_HANDLER_H_ |
OLD | NEW |