Chromium Code Reviews| Index: chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc |
| diff --git a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc |
| index 1ca6516a2e8c1f0e5413c997d7674596f81beb92..b20ed04669b277bf80d0b8c8453f3ac88b71f5ca 100644 |
| --- a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc |
| +++ b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc |
| @@ -47,6 +47,7 @@ namespace offline_pages { |
| namespace android { |
| namespace { |
| +const char kNativeTag[] = "OPNative"; |
| void ToJavaOfflinePageList(JNIEnv* env, |
| jobject j_result_obj, |
| @@ -214,6 +215,8 @@ OfflinePageEvaluationBridge::OfflinePageEvaluationBridge( |
| NotifyIfDoneLoading(); |
| offline_page_model_->AddObserver(this); |
| request_coordinator_->AddObserver(this); |
| + offline_page_model->GetLogger()->SetClient(this); |
|
fgorski
2016/11/30 17:30:47
be consistent with filed vs. parameter usage. (see
romax
2016/12/01 01:47:52
Done.
Not sure what you meant but my guess is that
|
| + request_coordinator->GetLogger()->SetClient(this); |
|
fgorski
2016/11/30 17:30:47
chili@:
I think what we are missing is the ability
romax
2016/12/01 01:47:52
I think a broader vision should be when OfflinePag
fgorski
2016/12/01 21:42:52
It's still doesn't solve the problem of having to
|
| } |
| OfflinePageEvaluationBridge::~OfflinePageEvaluationBridge() { |
| @@ -258,6 +261,13 @@ void OfflinePageEvaluationBridge::OnChanged(const SavePageRequest& request) { |
| env, java_ref_, ToJavaSavePageRequest(env, request)); |
| } |
| +void OfflinePageEvaluationBridge::CustomLog(const std::string& message) { |
| + JNIEnv* env = base::android::AttachCurrentThread(); |
| + Java_OfflinePageEvaluationBridge_log(env, java_ref_, |
| + ConvertUTF8ToJavaString(env, kNativeTag), |
| + ConvertUTF8ToJavaString(env, message)); |
| +} |
| + |
| void OfflinePageEvaluationBridge::GetAllPages( |
| JNIEnv* env, |
| const JavaParamRef<jobject>& obj, |