Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8725cc4be8efae1a60f554fa4095542400042142 |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.infobar; |
| + |
| +import org.chromium.base.annotations.CalledByNative; |
| +import org.chromium.chrome.browser.ResourceId; |
| + |
| +/** |
| + * An infobar to disclose to the user that the default search engine has geolocation access by |
| + * default. |
| + */ |
| +public class SearchGeolocationDisclosureInfoBar extends InfoBar { |
|
gone
2016/11/04 23:21:48
I guess you need a new class because you'll be spe
benwells
2016/11/07 08:36:06
This infobar will be pretty simple except it will
gone
2016/11/07 19:01:53
That InfoBar seems to be gone, but if I remember i
|
| + private final String mMessageText; |
| + |
| + @CalledByNative |
| + private static InfoBar show(int enumeratedIconId, String message) { |
| + int drawableId = ResourceId.mapToDrawableId(enumeratedIconId); |
| + return new SearchGeolocationDisclosureInfoBar(drawableId, message); |
| + } |
| + |
| + /** |
| + * Creates the infobar. |
| + * @param iconDrawableId Drawable ID corresponding to the icon that the infobar will show. |
| + * @param messageText Message to display in the infobar. |
| + */ |
| + private SearchGeolocationDisclosureInfoBar(int iconDrawableId, String messageText) { |
| + super(iconDrawableId, null, null); |
| + mMessageText = messageText; |
| + } |
| + |
| + /** |
| + * Used to specify button layout and custom content. |
| + * @param layout Handles user interface for the infobar. |
| + */ |
| + @Override |
| + public void createContent(InfoBarLayout layout) { |
| + layout.setMessage(mMessageText); |
|
gone
2016/11/04 23:21:48
I don't think this is necessary if you pass messag
benwells
2016/11/07 08:36:06
Done.
|
| + } |
| +} |