summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/extensions
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 21:54:49 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 21:54:49 +0000
commit98e94a40052f163889a5d6026a24d750edf28818 (patch)
treecc100e38a4f40b260080aad9b4713d764bd3e303 /chrome/browser/views/extensions
parentea4dbc90144ad244f4520ac78d87040f0ee84221 (diff)
downloadchromium_src-98e94a40052f163889a5d6026a24d750edf28818.zip
chromium_src-98e94a40052f163889a5d6026a24d750edf28818.tar.gz
chromium_src-98e94a40052f163889a5d6026a24d750edf28818.tar.bz2
Implement fading in for the InfoBubble base class.
For bubbles that are not shown as a direct result of a mouse click, we use fade in. This applies to the FirstRun bubble and the extension installed bubble. For bubbles that have controls (buttons/links) we fade out if interacting with those controls closes the bubble. This applies to the first run bubble, app launcher, extension installed bubble, bookmark bubble and the content settings bubble. BUG=None TEST=Make sure the above-mentioned bubbles fade in and out during hide and show as described above. Review URL: http://codereview.chromium.org/2079008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/extensions')
-rw-r--r--chrome/browser/views/extensions/extension_installed_bubble.cc16
-rw-r--r--chrome/browser/views/extensions/extension_installed_bubble.h2
2 files changed, 14 insertions, 4 deletions
diff --git a/chrome/browser/views/extensions/extension_installed_bubble.cc b/chrome/browser/views/extensions/extension_installed_bubble.cc
index 33f4dcf..1799ee4 100644
--- a/chrome/browser/views/extensions/extension_installed_bubble.cc
+++ b/chrome/browser/views/extensions/extension_installed_bubble.cc
@@ -70,7 +70,8 @@ class InstalledBubbleContent : public views::View,
InstalledBubbleContent(Extension* extension,
ExtensionInstalledBubble::BubbleType type,
SkBitmap* icon)
- : type_(type),
+ : info_bubble_(NULL),
+ type_(type),
info_(NULL),
create_shortcut_(false) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
@@ -134,10 +135,13 @@ class InstalledBubbleContent : public views::View,
// Whether to create a shortcut once the bubble closes.
bool create_shortcut() { return create_shortcut_;}
+ void set_info_bubble(InfoBubble* info_bubble) { info_bubble_ = info_bubble; }
+
virtual void ButtonPressed(
views::Button* sender,
const views::Event& event) {
if (sender == close_button_) {
+ info_bubble_->set_fade_away_on_close(true);
GetWidget()->Close();
} else if (sender == create_shortcut_view_) {
create_shortcut_ = create_shortcut_view_->checked();
@@ -219,6 +223,9 @@ class InstalledBubbleContent : public views::View,
close_button_->SetBounds(x - 1, y - 1, sz.width(), sz.height());
}
+ // The InfoBubble showing us.
+ InfoBubble* info_bubble_;
+
ExtensionInstalledBubble::BubbleType type_;
views::ImageView* icon_;
views::Label* heading_;
@@ -335,8 +342,11 @@ void ExtensionInstalledBubble::ShowInternal() {
bubble_content_ = new InstalledBubbleContent(extension_, type_,
&icon_);
- InfoBubble::Show(browser_view->GetWidget(), bounds, BubbleBorder::TOP_RIGHT,
- bubble_content_, this);
+ InfoBubble* info_bubble =
+ InfoBubble::Show(browser_view->GetWidget(), bounds,
+ BubbleBorder::TOP_RIGHT,
+ bubble_content_, this);
+ bubble_content_->set_info_bubble(info_bubble);
}
// InfoBubbleDelegate
diff --git a/chrome/browser/views/extensions/extension_installed_bubble.h b/chrome/browser/views/extensions/extension_installed_bubble.h
index 78ca9d1..ad93996 100644
--- a/chrome/browser/views/extensions/extension_installed_bubble.h
+++ b/chrome/browser/views/extensions/extension_installed_bubble.h
@@ -66,7 +66,7 @@ class ExtensionInstalledBubble
virtual void InfoBubbleClosing(InfoBubble* info_bubble,
bool closed_by_escape);
virtual bool CloseOnEscape() { return true; }
- virtual bool FadeOutOnClose() { return false; }
+ virtual bool FadeInOnShow() { return true; }
Extension* extension_;
Browser* browser_;