| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/offline_pages/evaluation/offline_page_evaluatio
n_bridge.h" | 5 #include "chrome/browser/android/offline_pages/evaluation/offline_page_evaluatio
n_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/callback_android.h" | 7 #include "base/android/callback_android.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 new android::EvaluationTestScheduler()); | 183 new android::EvaluationTestScheduler()); |
| 184 net::NetworkQualityEstimator::NetworkQualityProvider* | 184 net::NetworkQualityEstimator::NetworkQualityProvider* |
| 185 network_quality_estimator = | 185 network_quality_estimator = |
| 186 UINetworkQualityEstimatorServiceFactory::GetForProfile(profile); | 186 UINetworkQualityEstimatorServiceFactory::GetForProfile(profile); |
| 187 // TODO(fgorski): Something needs to keep the handle to the Notification | 187 // TODO(fgorski): Something needs to keep the handle to the Notification |
| 188 // dispatcher. | 188 // dispatcher. |
| 189 std::unique_ptr<RequestCoordinator> request_coordinator = | 189 std::unique_ptr<RequestCoordinator> request_coordinator = |
| 190 base::MakeUnique<RequestCoordinator>( | 190 base::MakeUnique<RequestCoordinator>( |
| 191 std::move(policy), std::move(prerenderer_offliner), std::move(queue), | 191 std::move(policy), std::move(prerenderer_offliner), std::move(queue), |
| 192 std::move(scheduler), network_quality_estimator); | 192 std::move(scheduler), network_quality_estimator); |
| 193 request_coordinator->SetImmediateScheduleCallbackForTest( | 193 request_coordinator->SetInternalStartProcessingCallbackForTest( |
| 194 base::Bind(&android::EvaluationTestScheduler::ImmediateScheduleCallback, | 194 base::Bind(&android::EvaluationTestScheduler::ImmediateScheduleCallback, |
| 195 base::Unretained(scheduler.get()))); | 195 base::Unretained(scheduler.get()))); |
| 196 | 196 |
| 197 DownloadNotifyingObserver::CreateAndStartObserving( | 197 DownloadNotifyingObserver::CreateAndStartObserving( |
| 198 request_coordinator.get(), | 198 request_coordinator.get(), |
| 199 base::MakeUnique<android::OfflinePageNotificationBridge>()); | 199 base::MakeUnique<android::OfflinePageNotificationBridge>()); |
| 200 | 200 |
| 201 return std::move(request_coordinator); | 201 return std::move(request_coordinator); |
| 202 } | 202 } |
| 203 | 203 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 339 |
| 340 void OfflinePageEvaluationBridge::NotifyIfDoneLoading() const { | 340 void OfflinePageEvaluationBridge::NotifyIfDoneLoading() const { |
| 341 if (!offline_page_model_->is_loaded()) | 341 if (!offline_page_model_->is_loaded()) |
| 342 return; | 342 return; |
| 343 JNIEnv* env = base::android::AttachCurrentThread(); | 343 JNIEnv* env = base::android::AttachCurrentThread(); |
| 344 Java_OfflinePageEvaluationBridge_offlinePageModelLoaded(env, java_ref_); | 344 Java_OfflinePageEvaluationBridge_offlinePageModelLoaded(env, java_ref_); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace android | 347 } // namespace android |
| 348 } // namespace offline_pages | 348 } // namespace offline_pages |
| OLD | NEW |