| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.DialogInterface; | 8 import android.content.DialogInterface; |
| 9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
| 10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 mShowPersistenceToggle = showPersistenceToggle; | 49 mShowPersistenceToggle = showPersistenceToggle; |
| 50 } | 50 } |
| 51 | 51 |
| 52 @Override | 52 @Override |
| 53 public void createContent(InfoBarLayout layout) { | 53 public void createContent(InfoBarLayout layout) { |
| 54 super.createContent(layout); | 54 super.createContent(layout); |
| 55 | 55 |
| 56 if (mShowPersistenceToggle) { | 56 if (mShowPersistenceToggle) { |
| 57 InfoBarControlLayout controlLayout = layout.addControlLayout(); | 57 InfoBarControlLayout controlLayout = layout.addControlLayout(); |
| 58 String description = | 58 String description = |
| 59 layout.getContext().getString(R.string.permission_infobar_pe
rsist_text); | 59 layout.getContext().getString(R.string.permission_prompt_per
sist_text); |
| 60 controlLayout.addSwitch( | 60 controlLayout.addSwitch( |
| 61 0, 0, description, R.id.permission_infobar_persist_toggle, t
rue); | 61 0, 0, description, R.id.permission_infobar_persist_toggle, t
rue); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 @Override | 65 @Override |
| 66 public void onTabReparented(Tab tab) { | 66 public void onTabReparented(Tab tab) { |
| 67 mWindowAndroid = tab.getWindowAndroid(); | 67 mWindowAndroid = tab.getWindowAndroid(); |
| 68 } | 68 } |
| 69 | 69 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 String buttonCancel, int[] contentSettings, boolean showPersistenceT
oggle) { | 232 String buttonCancel, int[] contentSettings, boolean showPersistenceT
oggle) { |
| 233 int drawableId = ResourceId.mapToDrawableId(enumeratedIconId); | 233 int drawableId = ResourceId.mapToDrawableId(enumeratedIconId); |
| 234 | 234 |
| 235 PermissionInfoBar infoBar = new PermissionInfoBar(drawableId, iconBitmap
, message, linkText, | 235 PermissionInfoBar infoBar = new PermissionInfoBar(drawableId, iconBitmap
, message, linkText, |
| 236 buttonOk, buttonCancel, showPersistenceToggle); | 236 buttonOk, buttonCancel, showPersistenceToggle); |
| 237 infoBar.setContentSettings(windowAndroid, contentSettings); | 237 infoBar.setContentSettings(windowAndroid, contentSettings); |
| 238 | 238 |
| 239 return infoBar; | 239 return infoBar; |
| 240 } | 240 } |
| 241 } | 241 } |
| OLD | NEW |