Index: chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc |
diff --git a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc |
index 1e69bcdfb5782a7a3237d3b4dc8fb7ea1a38db25..91f7766d9b53c44a3f3139b3d5cec93e22ce52f3 100644 |
--- a/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc |
+++ b/chrome/browser/ui/virtual_keyboard/virtual_keyboard_manager.cc |
@@ -21,12 +21,12 @@ |
#include "chrome/common/url_constants.h" |
#include "content/browser/site_instance.h" |
#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_observer.h" |
#include "ui/base/animation/animation_delegate.h" |
#include "ui/base/animation/slide_animation.h" |
#include "ui/base/ime/text_input_type.h" |
#include "ui/gfx/compositor/layer.h" |
-#include "ui/gfx/interpolated_transform.h" |
#include "ui/gfx/screen.h" |
#include "ui/views/ime/text_input_type_tracker.h" |
#include "ui/views/widget/widget.h" |
@@ -100,7 +100,7 @@ class KeyboardWidget |
// widget. |
views::Widget* GetBrowserWidget(); |
- // Update layer opacity and transform with values in animation_. |
+ // Update layer opacity and bounds with values in animation_. |
void UpdateForAnimation(); |
// Overridden from views::Widget. |
@@ -149,9 +149,6 @@ class KeyboardWidget |
// The animation. |
scoped_ptr<ui::SlideAnimation> animation_; |
- // Interpolated transform used during animation. |
- scoped_ptr<ui::InterpolatedTransform> transform_; |
- |
GURL keyboard_url_; |
// The DOM view to host the keyboard. |
@@ -229,7 +226,7 @@ KeyboardWidget::KeyboardWidget() |
#endif |
#if defined(USE_AURA) |
- aura::RootWindow::GetInstance()->AddObserver(this); |
+ aura::RootWindow::GetInstance()->AddRootWindowObserver(this); |
#endif |
} |
@@ -244,7 +241,7 @@ KeyboardWidget::~KeyboardWidget() { |
#endif |
#if defined(USE_AURA) |
- aura::RootWindow::GetInstance()->RemoveObserver(this); |
+ aura::RootWindow::GetInstance()->RemoveRootWindowObserver(this); |
#endif |
// TODO(sad): Do anything else? |
} |
@@ -254,9 +251,6 @@ void KeyboardWidget::ShowKeyboardForWidget(views::Widget* widget) { |
return; |
SetTarget(widget); |
- transform_.reset(new ui::InterpolatedTranslation( |
- gfx::Point(0, keyboard_height_), gfx::Point())); |
- |
UpdateForAnimation(); |
animation_->Show(); |
@@ -313,7 +307,9 @@ bool KeyboardWidget::OnKeyEvent(const views::KeyEvent& event) { |
void KeyboardWidget::UpdateForAnimation() { |
float t = static_cast<float>(animation_->GetCurrentValue()); |
- GetRootView()->SetTransform(transform_->Interpolate(t)); |
+ gfx::Rect bounds = GetKeyboardPosition(keyboard_height_); |
+ bounds.Offset(0, keyboard_height_*(1 - t)); |
+ SetBounds(bounds); |
hashimoto
2012/01/23 10:21:53
Replace SetTransform with SetBounds because virtua
sadrul
2012/01/23 22:47:57
I think this is a wrong thing to do. Changing the
hashimoto
2012/01/24 11:23:05
Unless |keyboard_height_| is changed, the size of
|
if (GetRootView()->layer()) |
GetRootView()->layer()->SetOpacity(t * t); |
} |