OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/glue/session_change_processor.h" | 5 #include "chrome/browser/sync/glue/session_change_processor.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "chrome/browser/extensions/extension_tab_helper.h" | 13 #include "chrome/browser/extensions/extension_tab_helper.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/sync/api/sync_error.h" | 15 #include "chrome/browser/sync/api/sync_error.h" |
16 #include "chrome/browser/sync/glue/session_model_associator.h" | 16 #include "chrome/browser/sync/glue/session_model_associator.h" |
17 #include "chrome/browser/sync/internal_api/change_record.h" | 17 #include "chrome/browser/sync/internal_api/change_record.h" |
18 #include "chrome/browser/sync/internal_api/read_node.h" | 18 #include "chrome/browser/sync/internal_api/read_node.h" |
19 #include "chrome/browser/sync/profile_sync_service.h" | 19 #include "chrome/browser/sync/profile_sync_service.h" |
20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "content/browser/tab_contents/navigation_controller.h" | 22 #include "content/browser/tab_contents/navigation_controller.h" |
23 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
25 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
26 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
27 | 27 |
| 28 using content::BrowserThread; |
| 29 |
28 namespace browser_sync { | 30 namespace browser_sync { |
29 | 31 |
30 namespace { | 32 namespace { |
31 | 33 |
32 // Extract the source SyncedTabDelegate from a NotificationSource originating | 34 // Extract the source SyncedTabDelegate from a NotificationSource originating |
33 // from a NavigationController, if it exists. Returns |NULL| otherwise. | 35 // from a NavigationController, if it exists. Returns |NULL| otherwise. |
34 SyncedTabDelegate* ExtractSyncedTabDelegate( | 36 SyncedTabDelegate* ExtractSyncedTabDelegate( |
35 const content::NotificationSource& source) { | 37 const content::NotificationSource& source) { |
36 TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( | 38 TabContentsWrapper* tab = TabContentsWrapper::GetCurrentWrapperForContents( |
37 content::Source<NavigationController>(source).ptr()->tab_contents()); | 39 content::Source<NavigationController>(source).ptr()->tab_contents()); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 content::NotificationService::AllBrowserContextsAndSources()); | 317 content::NotificationService::AllBrowserContextsAndSources()); |
316 } | 318 } |
317 | 319 |
318 void SessionChangeProcessor::StopObserving() { | 320 void SessionChangeProcessor::StopObserving() { |
319 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
320 DCHECK(profile_); | 322 DCHECK(profile_); |
321 notification_registrar_.RemoveAll(); | 323 notification_registrar_.RemoveAll(); |
322 } | 324 } |
323 | 325 |
324 } // namespace browser_sync | 326 } // namespace browser_sync |
OLD | NEW |