| 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 package org.chromium.chrome.browser.infobar; | 5 package org.chromium.chrome.browser.infobar; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.res.Resources; | 8 import android.content.res.Resources; |
| 9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
| 10 import android.support.v4.view.ViewCompat; |
| 10 import android.view.LayoutInflater; | 11 import android.view.LayoutInflater; |
| 11 import android.view.View; | 12 import android.view.View; |
| 12 import android.view.ViewGroup; | 13 import android.view.ViewGroup; |
| 13 import android.widget.Button; | 14 import android.widget.Button; |
| 14 import android.widget.ImageView; | 15 import android.widget.ImageView; |
| 15 import android.widget.RatingBar; | 16 import android.widget.RatingBar; |
| 16 import android.widget.TextView; | 17 import android.widget.TextView; |
| 17 | 18 |
| 18 import org.chromium.base.ApplicationStatus; | 19 import org.chromium.base.ApplicationStatus; |
| 19 import org.chromium.base.CalledByNative; | 20 import org.chromium.base.CalledByNative; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Web app. | 101 // Web app. |
| 101 webAppUrl.setText(mAppUrl); | 102 webAppUrl.setText(mAppUrl); |
| 102 mTitleView.setContentDescription(context.getString( | 103 mTitleView.setContentDescription(context.getString( |
| 103 R.string.app_banner_view_web_app_accessibility, mAppTitle, | 104 R.string.app_banner_view_web_app_accessibility, mAppTitle, |
| 104 mAppUrl)); | 105 mAppUrl)); |
| 105 mTitleView.removeView(ratingView); | 106 mTitleView.removeView(ratingView); |
| 106 | 107 |
| 107 } | 108 } |
| 108 | 109 |
| 109 // Hide uninteresting views from accessibility. | 110 // Hide uninteresting views from accessibility. |
| 110 ratingView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY
_NO); | 111 ViewCompat.setImportantForAccessibility(ratingView, View.IMPORTANT_FOR_A
CCESSIBILITY_NO); |
| 111 if (mIconView != null) { | 112 if (mIconView != null) { |
| 112 mIconView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBIL
ITY_NO); | 113 ViewCompat.setImportantForAccessibility(mIconView, View.IMPORTANT_FO
R_ACCESSIBILITY_NO); |
| 113 } | 114 } |
| 114 | 115 |
| 115 // Set up clicking on the controls to bring up the app details. | 116 // Set up clicking on the controls to bring up the app details. |
| 116 mTitleView.setOnClickListener(this); | 117 mTitleView.setOnClickListener(this); |
| 117 if (mIconView != null) mIconView.setOnClickListener(this); | 118 if (mIconView != null) mIconView.setOnClickListener(this); |
| 118 } | 119 } |
| 119 | 120 |
| 120 @Override | 121 @Override |
| 121 public void onButtonClicked(boolean isPrimaryButton) { | 122 public void onButtonClicked(boolean isPrimaryButton) { |
| 122 if (mInstallState == INSTALL_STATE_INSTALLING) { | 123 if (mInstallState == INSTALL_STATE_INSTALLING) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 long nativeInfoBar, String appTitle, Bitmap iconBitmap, AppData appD
ata) { | 171 long nativeInfoBar, String appTitle, Bitmap iconBitmap, AppData appD
ata) { |
| 171 return new AppBannerInfoBar(nativeInfoBar, appTitle, iconBitmap, appData
); | 172 return new AppBannerInfoBar(nativeInfoBar, appTitle, iconBitmap, appData
); |
| 172 } | 173 } |
| 173 | 174 |
| 174 @CalledByNative | 175 @CalledByNative |
| 175 private static InfoBar createWebAppInfoBar( | 176 private static InfoBar createWebAppInfoBar( |
| 176 long nativeInfoBar, String appTitle, Bitmap iconBitmap, String url)
{ | 177 long nativeInfoBar, String appTitle, Bitmap iconBitmap, String url)
{ |
| 177 return new AppBannerInfoBar(nativeInfoBar, appTitle, iconBitmap, url); | 178 return new AppBannerInfoBar(nativeInfoBar, appTitle, iconBitmap, url); |
| 178 } | 179 } |
| 179 } | 180 } |
| OLD | NEW |