summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 16:19:04 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 16:19:04 +0000
commitd217769230326a5af129b3cadae785706341a8f9 (patch)
treee19bd6eef46a749ec4d5e35ff765e86cb1594127 /chrome
parentc14a701e971413ac03c8758caec849fe61507f32 (diff)
downloadchromium_src-d217769230326a5af129b3cadae785706341a8f9.zip
chromium_src-d217769230326a5af129b3cadae785706341a8f9.tar.gz
chromium_src-d217769230326a5af129b3cadae785706341a8f9.tar.bz2
Split window_animations, moving basic animations to views/corewm.
The base definition of the animation type enum also moves to corewm, and the API now allows downstream libraries (like ash) to extend the set of animations available. This will allow us to more easily use "core" animations in desktop-aura. I also removed the internal namespace from window_animations that remained in ash, since the use of namespaces in that file had begun to confuse me. http://crbug.com/158115 R=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170071 Review URL: https://codereview.chromium.org/11412223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170195 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc4
-rw-r--r--chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc8
-rw-r--r--chrome/browser/chromeos/login/lock_window_aura.cc4
-rw-r--r--chrome/browser/chromeos/login/login_utils.cc3
-rw-r--r--chrome/browser/chromeos/login/webui_login_display_host.cc6
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc11
-rw-r--r--chrome/browser/ui/views/extensions/extension_popup.cc13
-rw-r--r--chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc20
-rw-r--r--chrome/test/base/test_launcher_utils.cc9
9 files changed, 39 insertions, 39 deletions
diff --git a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
index f298132..bd3aba9 100644
--- a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
+++ b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
@@ -45,10 +45,10 @@ class UserWallpaperDelegate : public ash::UserWallpaperDelegate {
virtual ~UserWallpaperDelegate() {
}
- virtual ash::WindowVisibilityAnimationType GetAnimationType() OVERRIDE {
+ virtual int GetAnimationType() OVERRIDE {
return ShouldShowInitialAnimation() ?
ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE :
- ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE;
+ static_cast<int>(views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
}
virtual bool ShouldShowInitialAnimation() OVERRIDE {
diff --git a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
index 51c5a72..f133dae 100644
--- a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
+++ b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc
@@ -60,9 +60,9 @@ void CandidateWindowControllerImpl::CreateView() {
#endif
frame_->Init(params);
#if defined(USE_ASH)
- ash::SetWindowVisibilityAnimationType(
+ views::corewm::SetWindowVisibilityAnimationType(
frame_->GetNativeView(),
- ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
+ views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
#endif // USE_ASH
// Create the candidate window.
@@ -77,9 +77,9 @@ void CandidateWindowControllerImpl::CreateView() {
infolist_window_.reset(new DelayableWidget);
infolist_window_->Init(params);
#if defined(USE_ASH)
- ash::SetWindowVisibilityAnimationType(
+ views::corewm::SetWindowVisibilityAnimationType(
infolist_window_->GetNativeView(),
- ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
+ views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
#endif // USE_ASH
InfolistWindowView* infolist_view = new InfolistWindowView;
diff --git a/chrome/browser/chromeos/login/lock_window_aura.cc b/chrome/browser/chromeos/login/lock_window_aura.cc
index 65be222..5ceadd1 100644
--- a/chrome/browser/chromeos/login/lock_window_aura.cc
+++ b/chrome/browser/chromeos/login/lock_window_aura.cc
@@ -52,8 +52,8 @@ void LockWindowAura::Init() {
ash::Shell::GetPrimaryRootWindow(),
ash::internal::kShellWindowId_LockScreenContainer);
views::Widget::Init(params);
- ash::SetWindowVisibilityAnimationTransition(GetNativeView(),
- ash::ANIMATE_NONE);
+ views::corewm::SetWindowVisibilityAnimationTransition(
+ GetNativeView(), views::corewm::ANIMATE_NONE);
}
} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index ebf77aa..ae8d4da 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -92,6 +92,7 @@
#include "ui/compositor/compositor_switches.h"
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
+#include "ui/views/corewm/corewm_switches.h"
#include "webkit/plugins/plugin_switches.h"
using content::BrowserThread;
@@ -814,7 +815,6 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine(
::switches::kUseGL,
::switches::kUserDataDir,
ash::switches::kAshTouchHud,
- ash::switches::kAshWindowAnimationsDisabled,
ash::switches::kAuraLegacyPowerButton,
ash::switches::kAuraNoShadows,
ash::switches::kAshDisablePanelFitting,
@@ -825,6 +825,7 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine(
chromeos::switches::kEnableNewNetworkHandlers,
gfx::switches::kEnableBrowserTextSubpixelPositioning,
gfx::switches::kEnableWebkitTextSubpixelPositioning,
+ views::corewm::switches::kWindowAnimationsDisabled,
};
command_line->CopySwitchesFrom(base_command_line,
kForwardSwitches,
diff --git a/chrome/browser/chromeos/login/webui_login_display_host.cc b/chrome/browser/chromeos/login/webui_login_display_host.cc
index 2b63525..ecc3cd0 100644
--- a/chrome/browser/chromeos/login/webui_login_display_host.cc
+++ b/chrome/browser/chromeos/login/webui_login_display_host.cc
@@ -294,12 +294,12 @@ void WebUILoginDisplayHost::LoadURL(const GURL& url) {
login_view_->Init(login_window_);
- ash::SetWindowVisibilityAnimationDuration(
+ views::corewm::SetWindowVisibilityAnimationDuration(
login_window_->GetNativeView(),
base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs));
- ash::SetWindowVisibilityAnimationTransition(
+ views::corewm::SetWindowVisibilityAnimationTransition(
login_window_->GetNativeView(),
- ash::ANIMATE_HIDE);
+ views::corewm::ANIMATE_HIDE);
login_window_->SetContentsView(login_view_);
login_view_->UpdateWindowType();
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 97f516c..efc0af3 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -56,13 +56,16 @@
#include "ui/views/widget/native_widget_win.h"
#endif
+#if defined(USE_AURA)
+#include "ui/views/corewm/window_animations.h"
+#endif
+
#if defined(USE_ASH)
#include "ash/ash_constants.h"
#include "ash/ash_switches.h"
#include "ash/shell.h"
#include "ash/wm/custom_frame_view_ash.h"
#include "ash/wm/visibility_controller.h"
-#include "ash/wm/window_animations.h"
#include "ash/wm/window_modality_controller.h"
#include "ui/aura/window.h"
#endif
@@ -638,11 +641,11 @@ ConstrainedWindowViews::~ConstrainedWindowViews() {
}
void ConstrainedWindowViews::ShowConstrainedWindow() {
-#if defined(USE_ASH)
+#if defined(USE_AURA)
if (enable_chrome_style_) {
- ash::SetWindowVisibilityAnimationType(
+ views::corewm::SetWindowVisibilityAnimationType(
GetNativeWindow(),
- ash::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
+ views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_ROTATE);
}
#endif
Show();
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
index 9b76789..12461f7 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -24,10 +24,7 @@
#if defined(USE_AURA)
#include "ui/aura/window.h"
-#endif
-
-#if defined(USE_ASH)
-#include "ash/wm/window_animations.h"
+#include "ui/views/corewm/window_animations.h"
#endif
using content::RenderViewHost;
@@ -187,12 +184,12 @@ ExtensionPopup* ExtensionPopup::ShowPopup(
arrow_location, show_action);
views::BubbleDelegateView::CreateBubble(popup);
-#if defined(USE_ASH)
+#if defined(USE_AURA)
gfx::NativeView native_view = popup->GetWidget()->GetNativeView();
- ash::SetWindowVisibilityAnimationType(
+ views::corewm::SetWindowVisibilityAnimationType(
native_view,
- ash::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
- ash::SetWindowVisibilityAnimationVerticalPosition(
+ views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
+ views::corewm::SetWindowVisibilityAnimationVerticalPosition(
native_view,
-3.0f);
#endif
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index 5cb8851..d80c1ab 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -16,6 +16,10 @@
#include "ui/gfx/path.h"
#include "ui/views/widget/widget.h"
+#if defined(USE_AURA)
+#include "ui/views/corewm/window_animations.h"
+#endif
+
#if defined(OS_WIN)
#include <dwmapi.h>
@@ -24,9 +28,6 @@
#include "ui/base/win/shell.h"
#endif
#endif
-#if defined(USE_ASH)
-#include "ash/wm/window_animations.h"
-#endif
namespace {
@@ -217,17 +218,14 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() {
params.bounds = GetPopupBounds();
params.context = location_bar_->GetWidget()->GetNativeView();
popup_->Init(params);
-#if defined(USE_ASH)
- ash::SetWindowVisibilityAnimationType(
+#if defined(USE_AURA)
+ views::corewm::SetWindowVisibilityAnimationType(
popup_->GetNativeView(),
- ash::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
- // Meanie-pants designers won't let us animate the appearance in
- // production, but we will do it anyway for desktop-aura for the time being
- // as it lets usverify quickly that hotness is enabled.
+ views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
#if defined(OS_CHROMEOS)
// No animation for autocomplete popup appearance.
- ash::SetWindowVisibilityAnimationTransition(
- popup_->GetNativeView(), ash::ANIMATE_HIDE);
+ views::corewm::SetWindowVisibilityAnimationTransition(
+ popup_->GetNativeView(), views::corewm::ANIMATE_HIDE);
#endif
#endif
popup_->SetContentsView(this);
diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc
index ac1c97e..d13053c 100644
--- a/chrome/test/base/test_launcher_utils.cc
+++ b/chrome/test/base/test_launcher_utils.cc
@@ -14,8 +14,8 @@
#include "chrome/common/chrome_switches.h"
#include "ui/gl/gl_switches.h"
-#if defined(USE_ASH)
-#include "ash/ash_switches.h"
+#if defined(USE_AURA)
+#include "ui/views/corewm/corewm_switches.h"
#endif
namespace test_launcher_utils {
@@ -49,10 +49,11 @@ void PrepareBrowserCommandLineForTests(CommandLine* command_line) {
// auto-update.
command_line->AppendSwitch(switches::kSkipGpuDataLoading);
-#if defined(USE_ASH)
+#if defined(USE_AURA)
// Disable window animations under Ash as the animations effect the
// coordinates returned and result in flake.
- command_line->AppendSwitch(ash::switches::kAshWindowAnimationsDisabled);
+ command_line->AppendSwitch(
+ views::corewm::switches::kWindowAnimationsDisabled);
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS)