| 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/chrome_keyboard_ui.h" | 5 #include "chrome/browser/ui/ash/chrome_keyboard_ui.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 content::RenderViewHost* render_view_host) { | 183 content::RenderViewHost* render_view_host) { |
| 184 content::HostZoomMap* zoom_map = | 184 content::HostZoomMap* zoom_map = |
| 185 content::HostZoomMap::GetDefaultForBrowserContext(browser_context()); | 185 content::HostZoomMap::GetDefaultForBrowserContext(browser_context()); |
| 186 DCHECK(zoom_map); | 186 DCHECK(zoom_map); |
| 187 int render_process_id = render_view_host->GetProcess()->GetID(); | 187 int render_process_id = render_view_host->GetProcess()->GetID(); |
| 188 int render_view_id = render_view_host->GetRoutingID(); | 188 int render_view_id = render_view_host->GetRoutingID(); |
| 189 zoom_map->SetTemporaryZoomLevel(render_process_id, render_view_id, 0); | 189 zoom_map->SetTemporaryZoomLevel(render_process_id, render_view_id, 0); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void ChromeKeyboardUI::ShowKeyboardContainer(aura::Window* container) { | 192 void ChromeKeyboardUI::ShowKeyboardContainer(aura::Window* container) { |
| 193 // TODO(bshe): Implement logic to decide which root window should display | |
| 194 // virtual keyboard. http://crbug.com/303429 | |
| 195 if (container->GetRootWindow() != ash::Shell::GetPrimaryRootWindow()) | |
| 196 NOTIMPLEMENTED(); | |
| 197 | |
| 198 KeyboardUIContent::ShowKeyboardContainer(container); | 193 KeyboardUIContent::ShowKeyboardContainer(container); |
| 199 } | 194 } |
| 200 | 195 |
| 201 bool ChromeKeyboardUI::ShouldWindowOverscroll(aura::Window* window) const { | 196 bool ChromeKeyboardUI::ShouldWindowOverscroll(aura::Window* window) const { |
| 202 aura::Window* root_window = window->GetRootWindow(); | 197 aura::Window* root_window = window->GetRootWindow(); |
| 203 if (!root_window) | 198 if (!root_window) |
| 204 return true; | 199 return true; |
| 205 | 200 |
| 206 if (root_window != GetKeyboardRootWindow()) | 201 if (root_window != GetKeyboardRootWindow()) |
| 207 return false; | 202 return false; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 236 event_args->Append(std::move(input_context)); | 231 event_args->Append(std::move(input_context)); |
| 237 | 232 |
| 238 std::unique_ptr<extensions::Event> event(new extensions::Event( | 233 std::unique_ptr<extensions::Event> event(new extensions::Event( |
| 239 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, | 234 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, |
| 240 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, | 235 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, |
| 241 std::move(event_args))); | 236 std::move(event_args))); |
| 242 event->restrict_to_browser_context = browser_context(); | 237 event->restrict_to_browser_context = browser_context(); |
| 243 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, | 238 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, |
| 244 std::move(event)); | 239 std::move(event)); |
| 245 } | 240 } |
| OLD | NEW |