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 "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" | 5 #include "chrome/browser/ui/ash/ash_keyboard_controller_proxy.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "chrome/browser/extensions/event_names.h" | 9 #include "chrome/browser/extensions/event_names.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 container->layer()->SetOpacity(1.0); | 176 container->layer()->SetOpacity(1.0); |
177 } | 177 } |
178 | 178 |
179 // TODO(bshe): Add animation observer and do the workspace resizing after | 179 // TODO(bshe): Add animation observer and do the workspace resizing after |
180 // animation finished. | 180 // animation finished. |
181 KeyboardControllerProxy::ShowKeyboardContainer(container); | 181 KeyboardControllerProxy::ShowKeyboardContainer(container); |
182 // GetTextInputClient may return NULL when keyboard-usability-experiment flag | 182 // GetTextInputClient may return NULL when keyboard-usability-experiment flag |
183 // is set. | 183 // is set. |
184 if (GetInputMethod()->GetTextInputClient()) { | 184 if (GetInputMethod()->GetTextInputClient()) { |
185 gfx::Rect showing_area = | 185 gfx::Rect showing_area = |
186 ash::DisplayController::GetPrimaryDisplay().work_area(); | 186 ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); |
187 GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(showing_area); | 187 GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(showing_area); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 void AshKeyboardControllerProxy::HideKeyboardContainer( | 191 void AshKeyboardControllerProxy::HideKeyboardContainer( |
192 aura::Window* container) { | 192 aura::Window* container) { |
193 // The following animation settings should persist within this function scope. | 193 // The following animation settings should persist within this function scope. |
194 // Otherwise, a call to base class function HideKeyboardContainer will hide | 194 // Otherwise, a call to base class function HideKeyboardContainer will hide |
195 // the container immediately. | 195 // the container immediately. |
196 ui::LayerAnimator* container_animator = container->layer()->GetAnimator(); | 196 ui::LayerAnimator* container_animator = container->layer()->GetAnimator(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 input_context->SetString("type", | 249 input_context->SetString("type", |
250 Context::ToString(TextInputTypeToGeneratedInputTypeEnum(type))); | 250 Context::ToString(TextInputTypeToGeneratedInputTypeEnum(type))); |
251 event_args->Append(input_context.release()); | 251 event_args->Append(input_context.release()); |
252 | 252 |
253 scoped_ptr<extensions::Event> event(new extensions::Event( | 253 scoped_ptr<extensions::Event> event(new extensions::Event( |
254 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, | 254 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, |
255 event_args.Pass())); | 255 event_args.Pass())); |
256 event->restrict_to_browser_context = context; | 256 event->restrict_to_browser_context = context; |
257 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); | 257 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); |
258 } | 258 } |
OLD | NEW |