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