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

Unified Diff: ash/common/popup_message.cc

Issue 2124173002: mash: Migrate popup_message to ash/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 5 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 | « ash/common/popup_message.h ('k') | ash/common/popup_message_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/popup_message.cc
diff --git a/ash/popup_message.cc b/ash/common/popup_message.cc
similarity index 93%
rename from ash/popup_message.cc
rename to ash/common/popup_message.cc
index 231e4daed57bc422d229b8c5545e6d1b7ba7f2f5..f745499d8c991a329afec6065c8f34c33221e83d 100644
--- a/ash/popup_message.cc
+++ b/ash/common/popup_message.cc
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/popup_message.h"
+#include "ash/common/popup_message.h"
-#include "ash/wm/window_animations.h"
+#include "ash/common/wm_lookup.h"
+#include "ash/common/wm_window.h"
#include "grit/ash_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/geometry/insets.h"
@@ -14,6 +15,7 @@
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/window_animations.h"
namespace ash {
namespace {
@@ -199,11 +201,10 @@ PopupMessage::PopupMessage(const base::string16& caption,
view_ = new MessageBubble(caption, message, message_type, anchor, arrow,
size_override, arrow_offset);
widget_ = view_->GetWidget();
-
- gfx::NativeView native_view = widget_->GetNativeView();
- wm::SetWindowVisibilityAnimationType(
- native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
- wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_HIDE);
+ WmWindow* window = WmLookup::Get()->GetWindowForWidget(widget_);
+ window->SetVisibilityAnimationType(
+ ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
+ window->SetVisibilityAnimationTransition(::wm::ANIMATE_HIDE);
view_->GetWidget()->Show();
}
@@ -221,11 +222,12 @@ void PopupMessage::Close() {
}
void PopupMessage::CancelHidingAnimation() {
- if (!widget_ || !widget_->GetNativeView())
+ if (!widget_)
return;
- gfx::NativeView native_view = widget_->GetNativeView();
- wm::SetWindowVisibilityAnimationTransition(native_view, wm::ANIMATE_NONE);
+ WmWindow* window = WmLookup::Get()->GetWindowForWidget(widget_);
+ if (window)
+ window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE);
}
} // namespace ash
« no previous file with comments | « ash/common/popup_message.h ('k') | ash/common/popup_message_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698