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

Unified Diff: chrome/browser/ui/views/bubble/bubble.cc

Issue 7529038: chromeos: Minor changes to volume/brightness bubble UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bubble/bubble.cc
diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc
index 4490c6b69be2a587f198f267eed95225f362dd00..b512c02c0f5b134e3bab05f00ee128aed80f0997 100644
--- a/chrome/browser/ui/views/bubble/bubble.cc
+++ b/chrome/browser/ui/views/bubble/bubble.cc
@@ -106,10 +106,10 @@ void Bubble::AnimationEnded(const ui::Animation* animation) {
}
void Bubble::AnimationProgressed(const ui::Animation* animation) {
-#if defined(OS_WIN)
// Set the opacity for the main contents window.
unsigned char opacity = static_cast<unsigned char>(
animation_->GetCurrentValue() * 255);
+#if defined(OS_WIN)
SetLayeredWindowAttributes(GetNativeView(), 0,
static_cast<byte>(opacity), LWA_ALPHA);
contents_->SchedulePaint();
@@ -118,7 +118,8 @@ void Bubble::AnimationProgressed(const ui::Animation* animation) {
border_->SetOpacity(opacity);
border_->border_contents()->SchedulePaint();
#else
- NOTIMPLEMENTED();
+ SetOpacity(opacity);
+ border_contents_->SchedulePaint();
#endif
}
@@ -175,6 +176,7 @@ void Bubble::InitBubble(views::Widget* parent,
position_relative_to_ = position_relative_to;
arrow_location_ = arrow_location;
contents_ = contents;
+ const bool fade_in = delegate_ && delegate_->FadeInOnShow();
// Create the main window.
#if defined(OS_WIN)
@@ -185,7 +187,6 @@ void Bubble::InitBubble(views::Widget* parent,
int extended_style = WS_EX_TOOLWINDOW;
// During FadeIn we need to turn on the layered window style to deal with
// transparency. This flag needs to be reset after fading in is complete.
- bool fade_in = delegate_ && delegate_->FadeInOnShow();
if (fade_in)
extended_style |= WS_EX_LAYERED;
set_window_ex_style(extended_style);
@@ -214,6 +215,8 @@ void Bubble::InitBubble(views::Widget* parent,
params.parent_widget = parent;
params.native_widget = this;
GetWidget()->Init(params);
+ if (fade_in)
+ SetOpacity(0);
#if defined(OS_CHROMEOS)
{
vector<int> params;
@@ -282,11 +285,12 @@ void Bubble::InitBubble(views::Widget* parent,
#if defined(OS_WIN)
border_->ShowWindow(SW_SHOW);
ShowWindow(SW_SHOW);
- if (fade_in)
- FadeIn();
#elif defined(TOOLKIT_USES_GTK)
GetWidget()->Show();
#endif
+
+ if (fade_in)
+ FadeIn();
}
void Bubble::RegisterEscapeAccelerator() {
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698