| 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 "ui/keyboard/keyboard_controller_proxy.h" | 5 #include "ui/keyboard/keyboard_controller_proxy.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "content/public/browser/site_instance.h" | 9 #include "content/public/browser/site_instance.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // different extension. This keeps the UX the same as Android. | 191 // different extension. This keeps the UX the same as Android. |
| 192 gfx::Rect bounds = GetKeyboardWindow()->bounds(); | 192 gfx::Rect bounds = GetKeyboardWindow()->bounds(); |
| 193 bounds.set_y(bounds.y() + bounds.height()); | 193 bounds.set_y(bounds.y() + bounds.height()); |
| 194 bounds.set_height(0); | 194 bounds.set_height(0); |
| 195 GetKeyboardWindow()->SetBounds(bounds); | 195 GetKeyboardWindow()->SetBounds(bounds); |
| 196 } | 196 } |
| 197 LoadContents(GetVirtualKeyboardUrl()); | 197 LoadContents(GetVirtualKeyboardUrl()); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 void KeyboardControllerProxy::SetController(KeyboardController* controller) { |
| 202 keyboard_controller_ = controller; |
| 203 } |
| 204 |
| 201 void KeyboardControllerProxy::SetupWebContents(content::WebContents* contents) { | 205 void KeyboardControllerProxy::SetupWebContents(content::WebContents* contents) { |
| 202 } | 206 } |
| 203 | 207 |
| 204 void KeyboardControllerProxy::OnWindowBoundsChanged( | 208 void KeyboardControllerProxy::OnWindowBoundsChanged( |
| 205 aura::Window* window, | 209 aura::Window* window, |
| 206 const gfx::Rect& old_bounds, | 210 const gfx::Rect& old_bounds, |
| 207 const gfx::Rect& new_bounds) { | 211 const gfx::Rect& new_bounds) { |
| 208 if (!shadow_) { | 212 if (!shadow_) { |
| 209 shadow_.reset(new wm::Shadow()); | 213 shadow_.reset(new wm::Shadow()); |
| 210 shadow_->Init(wm::Shadow::STYLE_ACTIVE); | 214 shadow_->Init(wm::Shadow::STYLE_ACTIVE); |
| 211 shadow_->layer()->SetVisible(true); | 215 shadow_->layer()->SetVisible(true); |
| 212 DCHECK(keyboard_contents_->GetNativeView()->parent()); | 216 DCHECK(keyboard_contents_->GetNativeView()->parent()); |
| 213 keyboard_contents_->GetNativeView()->parent()->layer()->Add( | 217 keyboard_contents_->GetNativeView()->parent()->layer()->Add( |
| 214 shadow_->layer()); | 218 shadow_->layer()); |
| 215 } | 219 } |
| 216 | 220 |
| 217 shadow_->SetContentBounds(new_bounds); | 221 shadow_->SetContentBounds(new_bounds); |
| 218 } | 222 } |
| 219 | 223 |
| 220 void KeyboardControllerProxy::OnWindowDestroyed(aura::Window* window) { | 224 void KeyboardControllerProxy::OnWindowDestroyed(aura::Window* window) { |
| 221 window->RemoveObserver(this); | 225 window->RemoveObserver(this); |
| 222 } | 226 } |
| 223 | 227 |
| 224 } // namespace keyboard | 228 } // namespace keyboard |
| OLD | NEW |