Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarView.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarView.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarView.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..40c341aa9f15b242193043a2f61b5aad8d90e696 |
--- /dev/null |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarView.java |
@@ -0,0 +1,62 @@ |
+// Copyright (c) 2013 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 android.content.Context; |
+ |
+/** |
+ * Functions needed to display an InfoBar UI. |
+ */ |
+public interface InfoBarView { |
+ /** |
+ * Prepare the InfoBar for display and adding InfoBar-specific controls to the layout. |
+ * @param layout Layout containing all of the controls. |
+ */ |
+ public void createContent(InfoBarLayout layout); |
+ |
+ /** |
+ * Returns the message indicating what the InfoBar is informing or asking the user about. |
+ * @param context Context to pull the string from. |
+ * @return The string to display. |
+ */ |
+ public CharSequence getMessageText(Context context); |
+ |
+ /** |
+ * Returns text to display on the primary button indicating that some action will be taken. |
+ * Setting this to null prevents the button from being created. |
+ * @param context Context to pull the string from. |
+ * @return The string to display. |
+ */ |
+ public String getPrimaryButtonText(Context context); |
+ |
+ /** |
+ * Returns text to display on the secondary button, typically indicating that some action will |
+ * not be taken. |
+ * |
+ * Example text includes "Cancel" or "Nope". Setting this to null prevents the button from |
+ * being created. It is illegal to have a secondary button without a primary button. |
+ * |
+ * @param context Context to pull the string from. |
+ * @return The string to display. |
+ */ |
+ public String getSecondaryButtonText(Context context); |
+ |
+ /** |
+ * Take some action related to the close button being clicked. |
+ */ |
+ public void onCloseButtonClicked(); |
+ |
+ /** |
+ * Performs some action related to either the primary or secondary button being pressed. |
+ * @param isPrimaryButton True if the primary button was clicked, false otherwise. |
+ */ |
+ public void onButtonClicked(boolean isPrimaryButton); |
+ |
+ /** |
+ * Sets whether or not controls for this View should be clickable. |
+ * @param state If set to false, controls cannot be clicked and will be grayed out. |
+ */ |
+ public void setControlsEnabled(boolean state); |
+} |