summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/infobars/infobars.h
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 02:34:08 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-17 02:34:08 +0000
commitf34e7963c796bda1eb7fd35f5eda0d878c2df4e6 (patch)
tree1c67e594a5d25adb0b842858f622e3038146b8b7 /chrome/browser/views/infobars/infobars.h
parentb304b6162c3a78063f1ed775e33995d8f2205ed4 (diff)
downloadchromium_src-f34e7963c796bda1eb7fd35f5eda0d878c2df4e6.zip
chromium_src-f34e7963c796bda1eb7fd35f5eda0d878c2df4e6.tar.gz
chromium_src-f34e7963c796bda1eb7fd35f5eda0d878c2df4e6.tar.bz2
First cut at adding Extension Infobars to the experimental API.
Originally described here: http://code.google.com/p/chromium/wiki/InfoBarExtensionAPI The API is simple: chrome.experimental.infoBar.show( {"htmlPath": "infobar.html"}, function(window) { // |window| is where the infobar was shown. }); To close it, you can simply call window.close() from within the InfoBar (infoBar.hide is not provided). The api is privileged (not available to content scripts directly). The minimum height for the infobar is regular height for our infobars (32 pixels), maximum is twice that and the actual size is determined by the content (within these constraints mentioned). See screenshot in bug. The icon on the far left is an extension icon with a dropdown menu showing the menu that shows when you right-click on the extension icon in the Omnibox/browser action container. BUG=26463 TEST=None (for now). Review URL: http://codereview.chromium.org/1049001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/infobars/infobars.h')
-rw-r--r--chrome/browser/views/infobars/infobars.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/views/infobars/infobars.h b/chrome/browser/views/infobars/infobars.h
index 970b1ab..7d04904 100644
--- a/chrome/browser/views/infobars/infobars.h
+++ b/chrome/browser/views/infobars/infobars.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -52,9 +52,9 @@ class InfoBar : public views::View,
// is called.
void Close();
- // The target height of the infobar, regardless of what its current height
+ // The target height of the InfoBar, regardless of what its current height
// is (due to animation).
- static const double kTargetHeight;
+ static const double kDefaultTargetHeight;
static const int kHorizontalPadding;
static const int kIconLabelSpacing;
@@ -81,6 +81,10 @@ class InfoBar : public views::View,
// (Will lead to this InfoBar being closed).
void RemoveInfoBar() const;
+ void set_target_height(double height) { target_height_ = height; }
+
+ SlideAnimation* animation() { return animation_.get(); }
+
// Returns a centered y-position of a control of height specified in
// |prefsize| within the standard InfoBar height. Stable during an animation.
int CenterY(const gfx::Size prefsize);
@@ -132,6 +136,9 @@ class InfoBar : public views::View,
// Used to delete this object after a return to the message loop.
ScopedRunnableMethodFactory<InfoBar> delete_factory_;
+ // The target height for the InfoBar.
+ double target_height_;
+
DISALLOW_COPY_AND_ASSIGN(InfoBar);
};