Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java

Issue 2446063002: Implement a modal permission dialog on Android gated by a feature. (Closed)
Patch Set: Move delegate creation and dispatch into constructor Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698