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 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h" | 11 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h" |
12 #include "chrome/browser/banners/app_banner_debug_log.h" | 12 #include "chrome/browser/banners/app_banner_debug_log.h" |
13 #include "chrome/browser/banners/app_banner_manager.h" | 13 #include "chrome/browser/banners/app_banner_manager.h" |
14 | 14 |
15 namespace banners { | 15 namespace banners { |
16 class AppBannerDataFetcherAndroid; | 16 class AppBannerDataFetcherAndroid; |
17 | 17 |
18 // Extends the AppBannerManager to support native Android apps. | 18 // Extends the AppBannerManager to support native Android apps. |
19 // TODO(dfalcantara): Flip it so the C++ AppBannerManagerAndroid owns the | 19 // TODO(dfalcantara): Flip it so the C++ AppBannerManagerAndroid owns the |
20 // Java AppBannerManager, move ownership of the AppBannerManagerAndroid to | 20 // Java AppBannerManager, move ownership of the AppBannerManagerAndroid to |
21 // the TabAndroid class, then move functions for retriving info from Java to | 21 // the TabAndroid class, then move functions for retriving info from Java to |
22 // the AppBannerDataFetcherAndroid. | 22 // the AppBannerDataFetcherAndroid. |
23 class AppBannerManagerAndroid : public AppBannerManager { | 23 class AppBannerManagerAndroid : public AppBannerManager { |
24 public: | 24 public: |
25 // Registers native methods. | 25 // Registers native methods. |
26 static bool Register(JNIEnv* env); | 26 static bool Register(JNIEnv* env); |
27 | 27 |
28 AppBannerManagerAndroid(JNIEnv* env, jobject obj, int icon_size); | 28 AppBannerManagerAndroid(JNIEnv* env, |
29 jobject obj, | |
30 int splash_icon_size, | |
Lalit Maganti
2015/08/26 13:11:56
Changed to have "ideal" and "in dp"
| |
31 int icon_size); | |
Lalit Maganti
2015/08/26 13:11:56
Changed to have "ideal" and "in dp"
| |
29 ~AppBannerManagerAndroid() override; | 32 ~AppBannerManagerAndroid() override; |
30 | 33 |
31 // Destroys the AppBannerManagerAndroid. | 34 // Destroys the AppBannerManagerAndroid. |
32 void Destroy(JNIEnv* env, jobject obj); | 35 void Destroy(JNIEnv* env, jobject obj); |
33 | 36 |
34 // Observes a new WebContents, if necessary. | 37 // Observes a new WebContents, if necessary. |
35 void ReplaceWebContents(JNIEnv* env, | 38 void ReplaceWebContents(JNIEnv* env, |
36 jobject obj, | 39 jobject obj, |
37 jobject jweb_contents); | 40 jobject jweb_contents); |
38 | 41 |
(...skipping 20 matching lines...) Expand all Loading... | |
59 const GURL& url, | 62 const GURL& url, |
60 const std::string& id) override; | 63 const std::string& id) override; |
61 | 64 |
62 bool CheckPlatformAndId(const std::string& platform, const std::string& id); | 65 bool CheckPlatformAndId(const std::string& platform, const std::string& id); |
63 | 66 |
64 bool CheckFetcherMatchesContents(); | 67 bool CheckFetcherMatchesContents(); |
65 | 68 |
66 std::string ExtractQueryValueForName(const GURL& url, | 69 std::string ExtractQueryValueForName(const GURL& url, |
67 const std::string& name); | 70 const std::string& name); |
68 | 71 |
72 // Ideal splashscreen icon size to use. | |
73 const int ideal_splash_icon_size_; | |
Lalit Maganti
2015/08/26 13:11:56
Changed to have "ideal" and "in dp"
| |
74 | |
69 // AppBannerManager on the Java side. | 75 // AppBannerManager on the Java side. |
70 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; | 76 JavaObjectWeakGlobalRef weak_java_banner_view_manager_; |
71 | 77 |
72 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); | 78 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); |
73 }; // class AppBannerManagerAndroid | 79 }; // class AppBannerManagerAndroid |
74 | 80 |
75 } // namespace banners | 81 } // namespace banners |
76 | 82 |
77 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 83 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
OLD | NEW |