Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / android / infobars / app_banner_infobar.h
blob72ef28ebf32270bbd5f0a383ab79fb1a0e5815a9
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_H_
8 #include "base/android/scoped_java_ref.h"
9 #include "base/basictypes.h"
10 #include "chrome/browser/ui/android/infobars/confirm_infobar.h"
11 #include "url/gurl.h"
13 namespace banners {
14 class AppBannerInfoBarDelegate;
15 } // namespace banners
18 class AppBannerInfoBar : public ConfirmInfoBar {
19 public:
20 // Constructs an AppBannerInfoBar promoting a native app.
21 AppBannerInfoBar(
22 scoped_ptr<banners::AppBannerInfoBarDelegate> delegate,
23 const base::android::ScopedJavaGlobalRef<jobject>& japp_data);
25 // Constructs an AppBannerInfoBar promoting a web app.
26 AppBannerInfoBar(
27 scoped_ptr<banners::AppBannerInfoBarDelegate> delegate,
28 const GURL& app_url);
30 ~AppBannerInfoBar() override;
32 // Called when the installation state of the app may have changed.
33 // Updates the InfoBar visuals to match the new state and re-enables controls
34 // that may have been disabled.
35 void OnInstallStateChanged(int new_state);
37 private:
38 // InfoBarAndroid overrides.
39 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
40 JNIEnv* env) override;
42 // Native app: Details about the app.
43 base::android::ScopedJavaGlobalRef<jobject> japp_data_;
45 // Web app: URL for the app.
46 GURL app_url_;
48 base::android::ScopedJavaGlobalRef<jobject> java_infobar_;
50 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBar);
53 // Register native methods.
54 bool RegisterAppBannerInfoBar(JNIEnv* env);
56 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_APP_BANNER_INFOBAR_H_