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 "components/dom_distiller/content/browser/distillable_page_utils_androi
d.h" | 5 #include "components/dom_distiller/content/browser/distillable_page_utils_androi
d.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "components/dom_distiller/content/browser/distillable_page_utils.h" | 13 #include "components/dom_distiller/content/browser/distillable_page_utils.h" |
14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
15 #include "jni/DistillablePageUtils_jni.h" | 15 #include "jni/DistillablePageUtils_jni.h" |
16 | 16 |
| 17 using base::android::JavaParamRef; |
17 using base::android::ScopedJavaGlobalRef; | 18 using base::android::ScopedJavaGlobalRef; |
18 | 19 |
19 namespace dom_distiller { | 20 namespace dom_distiller { |
20 namespace android { | 21 namespace android { |
21 namespace { | 22 namespace { |
22 void OnIsPageDistillableResult( | 23 void OnIsPageDistillableResult( |
23 std::unique_ptr<ScopedJavaGlobalRef<jobject>> callback_holder, | 24 std::unique_ptr<ScopedJavaGlobalRef<jobject>> callback_holder, |
24 bool isDistillable) { | 25 bool isDistillable) { |
25 Java_DistillablePageUtils_callOnIsPageDistillableResult( | 26 Java_DistillablePageUtils_callOnIsPageDistillableResult( |
26 base::android::AttachCurrentThread(), callback_holder->obj(), | 27 base::android::AttachCurrentThread(), callback_holder->obj(), |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 base::Bind(OnIsPageDistillableUpdate, base::Owned(callback_holder)); | 78 base::Bind(OnIsPageDistillableUpdate, base::Owned(callback_holder)); |
78 setDelegate(web_contents, delegate); | 79 setDelegate(web_contents, delegate); |
79 } | 80 } |
80 | 81 |
81 bool RegisterDistillablePageUtils(JNIEnv* env) { | 82 bool RegisterDistillablePageUtils(JNIEnv* env) { |
82 return RegisterNativesImpl(env); | 83 return RegisterNativesImpl(env); |
83 } | 84 } |
84 | 85 |
85 } | 86 } |
86 } | 87 } |
OLD | NEW |