| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/popup_message.h" | 5 #include "ash/popup_message.h" |
| 6 | 6 |
| 7 #include "ash/wm/window_animations.h" | 7 #include "ash/wm/window_animations.h" |
| 8 #include "grit/ash_resources.h" | 8 #include "grit/ash_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/insets.h" | 10 #include "ui/gfx/insets.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 views::BubbleBorder::Arrow arrow, | 187 views::BubbleBorder::Arrow arrow, |
| 188 const gfx::Size& size_override, | 188 const gfx::Size& size_override, |
| 189 int arrow_offset) | 189 int arrow_offset) |
| 190 : view_(NULL) { | 190 : view_(NULL) { |
| 191 view_ = new MessageBubble( | 191 view_ = new MessageBubble( |
| 192 caption, message, message_type, anchor, arrow, size_override, | 192 caption, message, message_type, anchor, arrow, size_override, |
| 193 arrow_offset); | 193 arrow_offset); |
| 194 widget_ = view_->GetWidget(); | 194 widget_ = view_->GetWidget(); |
| 195 | 195 |
| 196 gfx::NativeView native_view = widget_->GetNativeView(); | 196 gfx::NativeView native_view = widget_->GetNativeView(); |
| 197 views::corewm::SetWindowVisibilityAnimationType( | 197 wm::SetWindowVisibilityAnimationType( |
| 198 native_view, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 198 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
| 199 views::corewm::SetWindowVisibilityAnimationTransition( | 199 wm::SetWindowVisibilityAnimationTransition( |
| 200 native_view, views::corewm::ANIMATE_HIDE); | 200 native_view, wm::ANIMATE_HIDE); |
| 201 view_->GetWidget()->Show(); | 201 view_->GetWidget()->Show(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 PopupMessage::~PopupMessage() { | 204 PopupMessage::~PopupMessage() { |
| 205 CancelHidingAnimation(); | 205 CancelHidingAnimation(); |
| 206 Close(); | 206 Close(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void PopupMessage::Close() { | 209 void PopupMessage::Close() { |
| 210 if (view_) { | 210 if (view_) { |
| 211 view_->Close(); | 211 view_->Close(); |
| 212 view_ = NULL; | 212 view_ = NULL; |
| 213 widget_ = NULL; | 213 widget_ = NULL; |
| 214 } | 214 } |
| 215 } | 215 } |
| 216 | 216 |
| 217 void PopupMessage::CancelHidingAnimation() { | 217 void PopupMessage::CancelHidingAnimation() { |
| 218 if (!widget_ || !widget_->GetNativeView()) | 218 if (!widget_ || !widget_->GetNativeView()) |
| 219 return; | 219 return; |
| 220 | 220 |
| 221 gfx::NativeView native_view = widget_->GetNativeView(); | 221 gfx::NativeView native_view = widget_->GetNativeView(); |
| 222 views::corewm::SetWindowVisibilityAnimationTransition( | 222 wm::SetWindowVisibilityAnimationTransition( |
| 223 native_view, views::corewm::ANIMATE_NONE); | 223 native_view, wm::ANIMATE_NONE); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace ash | 226 } // namespace ash |
| OLD | NEW |