OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/data_usage/external_data_use_observer.h" | 5 #include "chrome/browser/android/data_usage/external_data_use_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 base::WeakPtr<ExternalDataUseObserver> ExternalDataUseObserver::GetWeakPtr() { | 210 base::WeakPtr<ExternalDataUseObserver> ExternalDataUseObserver::GetWeakPtr() { |
211 DCHECK(thread_checker_.CalledOnValidThread()); | 211 DCHECK(thread_checker_.CalledOnValidThread()); |
212 return weak_factory_.GetWeakPtr(); | 212 return weak_factory_.GetWeakPtr(); |
213 } | 213 } |
214 | 214 |
215 DataUseTabModel* ExternalDataUseObserver::GetDataUseTabModel() const { | 215 DataUseTabModel* ExternalDataUseObserver::GetDataUseTabModel() const { |
216 DCHECK(thread_checker_.CalledOnValidThread()); | 216 DCHECK(thread_checker_.CalledOnValidThread()); |
217 return data_use_tab_model_; | 217 return data_use_tab_model_; |
218 } | 218 } |
219 | 219 |
| 220 void ExternalDataUseObserver::SetRegisterGoogleVariationID( |
| 221 bool register_google_variation_id) { |
| 222 DCHECK(thread_checker_.CalledOnValidThread()); |
| 223 // It is okay to use base::Unretained here since |
| 224 // |external_data_use_observer_bridge_| is owned by |this|, and is destroyed |
| 225 // on UI thread when |this| is destroyed. |
| 226 ui_task_runner_->PostTask( |
| 227 FROM_HERE, |
| 228 base::Bind(&ExternalDataUseObserverBridge::SetRegisterGoogleVariationID, |
| 229 base::Unretained(external_data_use_observer_bridge_), |
| 230 register_google_variation_id)); |
| 231 } |
| 232 |
220 } // namespace android | 233 } // namespace android |
221 | 234 |
222 } // namespace chrome | 235 } // namespace chrome |
OLD | NEW |