| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/touch/keyboard/keyboard_manager.h" | 5 #include "chrome/browser/ui/touch/keyboard/keyboard_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
| 9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 transform_.reset(new ui::InterpolatedTranslation( | 140 transform_.reset(new ui::InterpolatedTranslation( |
| 141 gfx::Point(0, keyboard_height_), gfx::Point())); | 141 gfx::Point(0, keyboard_height_), gfx::Point())); |
| 142 | 142 |
| 143 GetRootView()->SetTransform( | 143 GetRootView()->SetTransform( |
| 144 transform_->Interpolate(animation_->GetCurrentValue())); | 144 transform_->Interpolate(animation_->GetCurrentValue())); |
| 145 animation_->Show(); | 145 animation_->Show(); |
| 146 | 146 |
| 147 MoveToTop(); | 147 MoveToTop(); |
| 148 Show(); | 148 Show(); |
| 149 |
| 150 bool visible = true; |
| 151 NotificationService::current()->Notify( |
| 152 NotificationType::KEYBOARD_VISIBILITY_CHANGED, |
| 153 Source<KeyboardManager>(this), |
| 154 Details<bool>(&visible)); |
| 149 } | 155 } |
| 150 | 156 |
| 151 void KeyboardManager::Hide() { | 157 void KeyboardManager::Hide() { |
| 152 animation_->Hide(); | 158 animation_->Hide(); |
| 159 |
| 160 bool visible = false; |
| 161 NotificationService::current()->Notify( |
| 162 NotificationType::KEYBOARD_VISIBILITY_CHANGED, |
| 163 Source<KeyboardManager>(this), |
| 164 Details<bool>(&visible)); |
| 153 } | 165 } |
| 154 | 166 |
| 155 bool KeyboardManager::OnKeyEvent(const views::KeyEvent& event) { | 167 bool KeyboardManager::OnKeyEvent(const views::KeyEvent& event) { |
| 156 return target_ ? target_->OnKeyEvent(event) : false; | 168 return target_ ? target_->OnKeyEvent(event) : false; |
| 157 } | 169 } |
| 158 | 170 |
| 159 void KeyboardManager::AnimationProgressed(const ui::Animation* animation) { | 171 void KeyboardManager::AnimationProgressed(const ui::Animation* animation) { |
| 160 GetRootView()->SetTransform( | 172 GetRootView()->SetTransform( |
| 161 transform_->Interpolate(animation_->GetCurrentValue())); | 173 transform_->Interpolate(animation_->GetCurrentValue())); |
| 162 } | 174 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 369 |
| 358 default: | 370 default: |
| 359 NOTREACHED(); | 371 NOTREACHED(); |
| 360 } | 372 } |
| 361 } | 373 } |
| 362 | 374 |
| 363 // static | 375 // static |
| 364 KeyboardManager* KeyboardManager::GetInstance() { | 376 KeyboardManager* KeyboardManager::GetInstance() { |
| 365 return Singleton<KeyboardManager>::get(); | 377 return Singleton<KeyboardManager>::get(); |
| 366 } | 378 } |
| OLD | NEW |