OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/banners/app_banner_manager.h" | 5 #include "chrome/browser/android/banners/app_banner_manager.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/command_line.h" | |
10 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
11 #include "chrome/browser/android/banners/app_banner_metrics_ids.h" | 10 #include "chrome/browser/android/banners/app_banner_metrics_ids.h" |
12 #include "chrome/browser/android/banners/app_banner_settings_helper.h" | 11 #include "chrome/browser/android/banners/app_banner_settings_helper.h" |
13 #include "chrome/browser/android/banners/app_banner_utilities.h" | 12 #include "chrome/browser/android/banners/app_banner_utilities.h" |
14 #include "chrome/browser/bitmap_fetcher.h" | 13 #include "chrome/browser/bitmap_fetcher.h" |
15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/chrome_switches.h" | |
17 #include "content/public/browser/android/content_view_core.h" | 15 #include "content/public/browser/android/content_view_core.h" |
18 #include "content/public/browser/navigation_details.h" | 16 #include "content/public/browser/navigation_details.h" |
19 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
20 #include "content/public/common/frame_navigate_params.h" | 18 #include "content/public/common/frame_navigate_params.h" |
21 #include "jni/AppBannerManager_jni.h" | 19 #include "jni/AppBannerManager_jni.h" |
22 #include "ui/gfx/android/java_bitmap.h" | 20 #include "ui/gfx/android/java_bitmap.h" |
23 | 21 |
24 using base::android::ConvertJavaStringToUTF8; | 22 using base::android::ConvertJavaStringToUTF8; |
25 using base::android::ConvertUTF8ToJavaString; | 23 using base::android::ConvertUTF8ToJavaString; |
26 | 24 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void RecordInstallEvent(JNIEnv* env, jclass clazz, jint metric) { | 143 void RecordInstallEvent(JNIEnv* env, jclass clazz, jint metric) { |
146 banners::TrackInstallEvent(metric); | 144 banners::TrackInstallEvent(metric); |
147 } | 145 } |
148 | 146 |
149 jlong Init(JNIEnv* env, jobject obj) { | 147 jlong Init(JNIEnv* env, jobject obj) { |
150 AppBannerManager* manager = new AppBannerManager(env, obj); | 148 AppBannerManager* manager = new AppBannerManager(env, obj); |
151 return reinterpret_cast<intptr_t>(manager); | 149 return reinterpret_cast<intptr_t>(manager); |
152 } | 150 } |
153 | 151 |
154 jboolean IsEnabled(JNIEnv* env, jclass clazz) { | 152 jboolean IsEnabled(JNIEnv* env, jclass clazz) { |
155 return !CommandLine::ForCurrentProcess()->HasSwitch( | 153 return false; |
156 switches::kDisableAppBanners); | |
157 } | 154 } |
158 | 155 |
159 // Register native methods | 156 // Register native methods |
160 bool RegisterAppBannerManager(JNIEnv* env) { | 157 bool RegisterAppBannerManager(JNIEnv* env) { |
161 return RegisterNativesImpl(env); | 158 return RegisterNativesImpl(env); |
162 } | 159 } |
163 | 160 |
164 } // namespace banners | 161 } // namespace banners |
OLD | NEW |