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/data_use_tab_ui_manager_android.h" | 5 #include "chrome/browser/android/data_usage/data_use_tab_ui_manager_android.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
12 #include "chrome/browser/android/data_usage/data_use_ui_tab_model.h" | 12 #include "chrome/browser/android/data_usage/data_use_ui_tab_model.h" |
13 #include "chrome/browser/android/data_usage/data_use_ui_tab_model_factory.h" | 13 #include "chrome/browser/android/data_usage/data_use_ui_tab_model_factory.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/profiles/profile_android.h" | 15 #include "chrome/browser/profiles/profile_android.h" |
16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
17 #include "components/sessions/core/session_id.h" | 17 #include "components/sessions/core/session_id.h" |
18 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
19 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
20 #include "jni/DataUseTabUIManager_jni.h" | 20 #include "jni/DataUseTabUIManager_jni.h" |
21 #include "net/android/network_library.h" | 21 #include "net/android/network_library.h" |
22 #include "net/base/network_change_notifier.h" | 22 #include "net/base/network_change_notifier.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 | 24 |
| 25 using base::android::JavaParamRef; |
| 26 using base::android::ScopedJavaLocalRef; |
| 27 |
25 namespace { | 28 namespace { |
26 | 29 |
27 // Represents the IDs for string messages used by data use snackbar and | 30 // Represents the IDs for string messages used by data use snackbar and |
28 // interstitial dialog. A Java counterpart will be generated for this enum. | 31 // interstitial dialog. A Java counterpart will be generated for this enum. |
29 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.datausage | 32 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.datausage |
30 enum DataUseUIMessage { | 33 enum DataUseUIMessage { |
31 DATA_USE_TRACKING_STARTED_SNACKBAR_MESSAGE, | 34 DATA_USE_TRACKING_STARTED_SNACKBAR_MESSAGE, |
32 DATA_USE_TRACKING_SNACKBAR_ACTION, | 35 DATA_USE_TRACKING_SNACKBAR_ACTION, |
33 DATA_USE_TRACKING_ENDED_SNACKBAR_MESSAGE, | 36 DATA_USE_TRACKING_ENDED_SNACKBAR_MESSAGE, |
34 DATA_USE_TRACKING_ENDED_TITLE, | 37 DATA_USE_TRACKING_ENDED_TITLE, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 jboolean IsNonRoamingCellularConnection(JNIEnv* env, | 184 jboolean IsNonRoamingCellularConnection(JNIEnv* env, |
182 const JavaParamRef<jclass>& clazz) { | 185 const JavaParamRef<jclass>& clazz) { |
183 return net::NetworkChangeNotifier::IsConnectionCellular( | 186 return net::NetworkChangeNotifier::IsConnectionCellular( |
184 net::NetworkChangeNotifier::GetConnectionType()) && | 187 net::NetworkChangeNotifier::GetConnectionType()) && |
185 !net::android::GetIsRoaming(); | 188 !net::android::GetIsRoaming(); |
186 } | 189 } |
187 | 190 |
188 bool RegisterDataUseTabUIManager(JNIEnv* env) { | 191 bool RegisterDataUseTabUIManager(JNIEnv* env) { |
189 return RegisterNativesImpl(env); | 192 return RegisterNativesImpl(env); |
190 } | 193 } |
OLD | NEW |