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

Unified Diff: ash/frame/caption_buttons/frame_caption_button.cc

Issue 316693002: Reland Window Control Animations for TouchView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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
Index: ash/frame/caption_buttons/frame_caption_button.cc
diff --git a/ash/frame/caption_buttons/frame_caption_button.cc b/ash/frame/caption_buttons/frame_caption_button.cc
index c8d71c39c13a8cb2391dc231fe2fee0ece2096fb..df41fb45b5574758ae040b72a19ada6455160e01 100644
--- a/ash/frame/caption_buttons/frame_caption_button.cc
+++ b/ash/frame/caption_buttons/frame_caption_button.cc
@@ -5,9 +5,11 @@
#include "ash/frame/caption_buttons/frame_caption_button.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/compositor/layer.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
+#include "ui/views/widget/widget.h"
namespace ash {
@@ -37,6 +39,10 @@ FrameCaptionButton::FrameCaptionButton(views::ButtonListener* listener,
swap_images_animation_(new gfx::SlideAnimation(this)) {
swap_images_animation_->Reset(1);
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(false);
+ set_layer_owner_delegate(this);
+
// Do not flip the gfx::Canvas passed to the OnPaint() method. The snap left
// and snap right button icons should not be flipped. The other icons are
// horizontally symmetrical.
@@ -174,4 +180,9 @@ void FrameCaptionButton::PaintCentered(gfx::Canvas* canvas,
paint);
}
+void FrameCaptionButton::OnLayerRecreated(ui::Layer* old_layer,
+ ui::Layer* new_layer) {
+ GetWidget()->UpdateRootLayers();
+}
+
} // namespace ash
« no previous file with comments | « ash/frame/caption_buttons/frame_caption_button.h ('k') | ash/frame/caption_buttons/frame_caption_button_container_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698