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_bridge.h" | 5 #include "chrome/browser/android/data_usage/external_data_use_observer_bridge.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 io_task_runner_->PostTask( | 165 io_task_runner_->PostTask( |
166 FROM_HERE, base::Bind(&ExternalDataUseObserver::OnReportDataUseDone, | 166 FROM_HERE, base::Bind(&ExternalDataUseObserver::OnReportDataUseDone, |
167 external_data_use_observer_, success)); | 167 external_data_use_observer_, success)); |
168 } | 168 } |
169 | 169 |
170 void ExternalDataUseObserverBridge::OnControlAppInstallStateChange( | 170 void ExternalDataUseObserverBridge::OnControlAppInstallStateChange( |
171 JNIEnv* env, | 171 JNIEnv* env, |
172 jobject obj, | 172 jobject obj, |
173 bool is_control_app_installed) const { | 173 bool is_control_app_installed) const { |
174 DCHECK(thread_checker_.CalledOnValidThread()); | 174 DCHECK(thread_checker_.CalledOnValidThread()); |
175 data_use_tab_model_->OnControlAppInstallStateChange(is_control_app_installed); | 175 data_use_tab_model_->OnControlAppInstallStateChange(is_control_app_installed); |
tbansal1
2016/03/10 17:44:55
Add:
if(!data_use_tab_model_)
return;
Raj
2016/03/10 18:30:11
Done.
| |
176 } | 176 } |
177 | 177 |
178 void ExternalDataUseObserverBridge::ShouldRegisterAsDataUseObserver( | |
179 bool should_register) const { | |
180 DCHECK(thread_checker_.CalledOnValidThread()); | |
181 io_task_runner_->PostTask( | |
182 FROM_HERE, | |
183 base::Bind(&ExternalDataUseObserver::ShouldRegisterAsDataUseObserver, | |
184 external_data_use_observer_, should_register)); | |
185 } | |
186 | |
178 bool RegisterExternalDataUseObserver(JNIEnv* env) { | 187 bool RegisterExternalDataUseObserver(JNIEnv* env) { |
179 return RegisterNativesImpl(env); | 188 return RegisterNativesImpl(env); |
180 } | 189 } |
181 | 190 |
182 } // namespace android | 191 } // namespace android |
183 | 192 |
184 } // namespace chrome | 193 } // namespace chrome |
OLD | NEW |