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 #include "chrome/browser/sync/glue/session_change_processor.h" | 5 #include "chrome/browser/sync/glue/session_change_processor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return SyncedTabDelegate::ImplFromWebContents( | 51 return SyncedTabDelegate::ImplFromWebContents( |
52 content::Source<NavigationController>(source).ptr()->GetWebContents()); | 52 content::Source<NavigationController>(source).ptr()->GetWebContents()); |
53 } | 53 } |
54 | 54 |
55 } // namespace | 55 } // namespace |
56 | 56 |
57 SessionChangeProcessor::SessionChangeProcessor( | 57 SessionChangeProcessor::SessionChangeProcessor( |
58 DataTypeErrorHandler* error_handler, | 58 DataTypeErrorHandler* error_handler, |
59 SessionModelAssociator* session_model_associator) | 59 SessionModelAssociator* session_model_associator) |
60 : ChangeProcessor(error_handler), | 60 : ChangeProcessor(error_handler), |
61 weak_ptr_factory_(this), | |
62 session_model_associator_(session_model_associator), | 61 session_model_associator_(session_model_associator), |
63 profile_(NULL), | 62 profile_(NULL), |
64 setup_for_test_(false) { | 63 setup_for_test_(false), |
| 64 weak_ptr_factory_(this) { |
65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
66 DCHECK(error_handler); | 66 DCHECK(error_handler); |
67 DCHECK(session_model_associator_); | 67 DCHECK(session_model_associator_); |
68 } | 68 } |
69 | 69 |
70 SessionChangeProcessor::SessionChangeProcessor( | 70 SessionChangeProcessor::SessionChangeProcessor( |
71 DataTypeErrorHandler* error_handler, | 71 DataTypeErrorHandler* error_handler, |
72 SessionModelAssociator* session_model_associator, | 72 SessionModelAssociator* session_model_associator, |
73 bool setup_for_test) | 73 bool setup_for_test) |
74 : ChangeProcessor(error_handler), | 74 : ChangeProcessor(error_handler), |
75 weak_ptr_factory_(this), | |
76 session_model_associator_(session_model_associator), | 75 session_model_associator_(session_model_associator), |
77 profile_(NULL), | 76 profile_(NULL), |
78 setup_for_test_(setup_for_test) { | 77 setup_for_test_(setup_for_test), |
| 78 weak_ptr_factory_(this) { |
79 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 79 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
80 DCHECK(error_handler); | 80 DCHECK(error_handler); |
81 DCHECK(session_model_associator_); | 81 DCHECK(session_model_associator_); |
82 } | 82 } |
83 | 83 |
84 SessionChangeProcessor::~SessionChangeProcessor() { | 84 SessionChangeProcessor::~SessionChangeProcessor() { |
85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 85 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
86 } | 86 } |
87 | 87 |
88 void SessionChangeProcessor::Observe( | 88 void SessionChangeProcessor::Observe( |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 ManagedUserService* managed_user_service = | 382 ManagedUserService* managed_user_service = |
383 ManagedUserServiceFactory::GetForProfile(profile_); | 383 ManagedUserServiceFactory::GetForProfile(profile_); |
384 managed_user_service->AddNavigationBlockedCallback( | 384 managed_user_service->AddNavigationBlockedCallback( |
385 base::Bind(&SessionChangeProcessor::OnNavigationBlocked, | 385 base::Bind(&SessionChangeProcessor::OnNavigationBlocked, |
386 weak_ptr_factory_.GetWeakPtr())); | 386 weak_ptr_factory_.GetWeakPtr())); |
387 } | 387 } |
388 #endif | 388 #endif |
389 } | 389 } |
390 | 390 |
391 } // namespace browser_sync | 391 } // namespace browser_sync |
OLD | NEW |