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/feedback/connectivity_checker.h" | 5 #include "chrome/browser/android/feedback/connectivity_checker.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.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 "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/profiles/profile_android.h" | 16 #include "chrome/browser/profiles/profile_android.h" |
17 #include "jni/ConnectivityChecker_jni.h" | 17 #include "jni/ConnectivityChecker_jni.h" |
18 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
19 #include "net/http/http_status_code.h" | 19 #include "net/http/http_status_code.h" |
20 #include "net/url_request/url_fetcher.h" | 20 #include "net/url_request/url_fetcher.h" |
21 #include "net/url_request/url_fetcher_delegate.h" | 21 #include "net/url_request/url_fetcher_delegate.h" |
22 #include "net/url_request/url_request_context_getter.h" | 22 #include "net/url_request/url_request_context_getter.h" |
23 #include "net/url_request/url_request_status.h" | 23 #include "net/url_request/url_request_status.h" |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 | 25 |
| 26 using base::android::JavaParamRef; |
| 27 |
26 namespace chrome { | 28 namespace chrome { |
27 namespace android { | 29 namespace android { |
28 | 30 |
29 namespace { | 31 namespace { |
30 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.feedback | 32 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.feedback |
31 // GENERATED_JAVA_PREFIX_TO_STRIP: CONNECTIVITY_CHECK_RESULT_ | 33 // GENERATED_JAVA_PREFIX_TO_STRIP: CONNECTIVITY_CHECK_RESULT_ |
32 enum ConnectivityCheckResult { | 34 enum ConnectivityCheckResult { |
33 CONNECTIVITY_CHECK_RESULT_UNKNOWN = 0, | 35 CONNECTIVITY_CHECK_RESULT_UNKNOWN = 0, |
34 CONNECTIVITY_CHECK_RESULT_CONNECTED = 1, | 36 CONNECTIVITY_CHECK_RESULT_CONNECTED = 1, |
35 CONNECTIVITY_CHECK_RESULT_NOT_CONNECTED = 2, | 37 CONNECTIVITY_CHECK_RESULT_NOT_CONNECTED = 2, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 GURL url(base::android::ConvertJavaStringToUTF8(env, j_url)); | 196 GURL url(base::android::ConvertJavaStringToUTF8(env, j_url)); |
195 return url.is_valid(); | 197 return url.is_valid(); |
196 } | 198 } |
197 | 199 |
198 bool RegisterConnectivityChecker(JNIEnv* env) { | 200 bool RegisterConnectivityChecker(JNIEnv* env) { |
199 return RegisterNativesImpl(env); | 201 return RegisterNativesImpl(env); |
200 } | 202 } |
201 | 203 |
202 } // namespace android | 204 } // namespace android |
203 } // namespace chrome | 205 } // namespace chrome |
OLD | NEW |