Chromium Code Reviews| 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/extension_function_dispatcher.h" | 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 bool handled = true; | 133 bool handled = true; |
| 134 IPC_BEGIN_MESSAGE_MAP(AshKeyboardControllerProxy, message) | 134 IPC_BEGIN_MESSAGE_MAP(AshKeyboardControllerProxy, message) |
| 135 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 135 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
| 136 IPC_MESSAGE_UNHANDLED(handled = false) | 136 IPC_MESSAGE_UNHANDLED(handled = false) |
| 137 IPC_END_MESSAGE_MAP() | 137 IPC_END_MESSAGE_MAP() |
| 138 return handled; | 138 return handled; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void AshKeyboardControllerProxy::ShowKeyboardContainer( | 141 void AshKeyboardControllerProxy::ShowKeyboardContainer( |
| 142 aura::Window* container) { | 142 aura::Window* container) { |
| 143 // TODO(bshe): Implements logic to decide which root window should display | |
|
varkha
2013/10/04 01:54:07
nit: s/Implements/Implement ?
bshe
2013/10/04 03:04:39
Done.
| |
| 144 // virtual keyboard. http://crbug.com/303429 | |
| 145 if (container->GetRootWindow() != ash::Shell::GetPrimaryRootWindow()) | |
| 146 NOTIMPLEMENTED(); | |
| 147 | |
| 143 KeyboardControllerProxy::ShowKeyboardContainer(container); | 148 KeyboardControllerProxy::ShowKeyboardContainer(container); |
| 144 gfx::Rect showing_area = | 149 gfx::Rect showing_area = |
| 145 ash::DisplayController::GetPrimaryDisplay().work_area(); | 150 ash::DisplayController::GetPrimaryDisplay().work_area(); |
| 146 GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(showing_area); | 151 GetInputMethod()->GetTextInputClient()->EnsureCaretInRect(showing_area); |
| 147 } | 152 } |
| 148 | 153 |
| 149 void AshKeyboardControllerProxy::SetUpdateInputType(ui::TextInputType type) { | 154 void AshKeyboardControllerProxy::SetUpdateInputType(ui::TextInputType type) { |
| 150 // TODO(bshe): Need to check the affected window's profile once multi-profile | 155 // TODO(bshe): Need to check the affected window's profile once multi-profile |
| 151 // is supported. | 156 // is supported. |
| 152 Profile* profile = ProfileManager::GetDefaultProfile(); | 157 Profile* profile = ProfileManager::GetDefaultProfile(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 163 input_context->SetString("type", | 168 input_context->SetString("type", |
| 164 Context::ToString(TextInputTypeToGeneratedInputTypeEnum(type))); | 169 Context::ToString(TextInputTypeToGeneratedInputTypeEnum(type))); |
| 165 event_args->Append(input_context.release()); | 170 event_args->Append(input_context.release()); |
| 166 | 171 |
| 167 scoped_ptr<extensions::Event> event(new extensions::Event( | 172 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 168 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, | 173 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, |
| 169 event_args.Pass())); | 174 event_args.Pass())); |
| 170 event->restrict_to_profile = profile; | 175 event->restrict_to_profile = profile; |
| 171 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); | 176 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); |
| 172 } | 177 } |
| OLD | NEW |