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