Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: ash/root_window_controller.cc

Issue 1008453002: Allow javascript change the virtual keyboard window size and position freely in FLOATING mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/ash.gyp ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 26 matching lines...) Expand all
37 #include "ash/wm/lock_layout_manager.h" 37 #include "ash/wm/lock_layout_manager.h"
38 #include "ash/wm/panels/attached_panel_window_targeter.h" 38 #include "ash/wm/panels/attached_panel_window_targeter.h"
39 #include "ash/wm/panels/panel_layout_manager.h" 39 #include "ash/wm/panels/panel_layout_manager.h"
40 #include "ash/wm/panels/panel_window_event_handler.h" 40 #include "ash/wm/panels/panel_window_event_handler.h"
41 #include "ash/wm/root_window_layout_manager.h" 41 #include "ash/wm/root_window_layout_manager.h"
42 #include "ash/wm/screen_dimmer.h" 42 #include "ash/wm/screen_dimmer.h"
43 #include "ash/wm/stacking_controller.h" 43 #include "ash/wm/stacking_controller.h"
44 #include "ash/wm/status_area_layout_manager.h" 44 #include "ash/wm/status_area_layout_manager.h"
45 #include "ash/wm/system_background_controller.h" 45 #include "ash/wm/system_background_controller.h"
46 #include "ash/wm/system_modal_container_layout_manager.h" 46 #include "ash/wm/system_modal_container_layout_manager.h"
47 #include "ash/wm/virtual_keyboard_container_layout_manager.h"
48 #include "ash/wm/window_properties.h" 47 #include "ash/wm/window_properties.h"
49 #include "ash/wm/window_state.h" 48 #include "ash/wm/window_state.h"
50 #include "ash/wm/window_util.h" 49 #include "ash/wm/window_util.h"
51 #include "ash/wm/workspace/workspace_layout_manager.h" 50 #include "ash/wm/workspace/workspace_layout_manager.h"
52 #include "ash/wm/workspace_controller.h" 51 #include "ash/wm/workspace_controller.h"
53 #include "base/command_line.h" 52 #include "base/command_line.h"
54 #include "base/time/time.h" 53 #include "base/time/time.h"
55 #include "ui/aura/client/aura_constants.h" 54 #include "ui/aura/client/aura_constants.h"
56 #include "ui/aura/client/screen_position_client.h" 55 #include "ui/aura/client/screen_position_client.h"
57 #include "ui/aura/window.h" 56 #include "ui/aura/window.h"
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 keyboard_controller->AddObserver(workspace_controller_->layout_manager()); 627 keyboard_controller->AddObserver(workspace_controller_->layout_manager());
629 keyboard_controller->AddObserver( 628 keyboard_controller->AddObserver(
630 always_on_top_controller_->GetLayoutManager()); 629 always_on_top_controller_->GetLayoutManager());
631 Shell::GetInstance()->delegate()->VirtualKeyboardActivated(true); 630 Shell::GetInstance()->delegate()->VirtualKeyboardActivated(true);
632 aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer); 631 aura::Window* parent = GetContainer(kShellWindowId_ImeWindowParentContainer);
633 DCHECK(parent); 632 DCHECK(parent);
634 aura::Window* keyboard_container = 633 aura::Window* keyboard_container =
635 keyboard_controller->GetContainerWindow(); 634 keyboard_controller->GetContainerWindow();
636 keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer); 635 keyboard_container->set_id(kShellWindowId_VirtualKeyboardContainer);
637 parent->AddChild(keyboard_container); 636 parent->AddChild(keyboard_container);
638 // TODO(oshima): Bounds of keyboard container should be handled by
639 // RootWindowLayoutManager. Remove this after fixed RootWindowLayoutManager.
640 keyboard_container->SetBounds(parent->bounds());
641 } 637 }
642 638
643 void RootWindowController::DeactivateKeyboard( 639 void RootWindowController::DeactivateKeyboard(
644 keyboard::KeyboardController* keyboard_controller) { 640 keyboard::KeyboardController* keyboard_controller) {
645 if (!keyboard_controller || 641 if (!keyboard_controller ||
646 !keyboard_controller->keyboard_container_initialized()) { 642 !keyboard_controller->keyboard_container_initialized()) {
647 return; 643 return;
648 } 644 }
649 aura::Window* keyboard_container = 645 aura::Window* keyboard_container =
650 keyboard_controller->GetContainerWindow(); 646 keyboard_controller->GetContainerWindow();
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 wm::SetSnapsChildrenToPhysicalPixelBoundary(settings_bubble_container); 982 wm::SetSnapsChildrenToPhysicalPixelBoundary(settings_bubble_container);
987 SetUsesScreenCoordinates(settings_bubble_container); 983 SetUsesScreenCoordinates(settings_bubble_container);
988 DescendantShouldStayInSameRootWindow(settings_bubble_container); 984 DescendantShouldStayInSameRootWindow(settings_bubble_container);
989 985
990 aura::Window* virtual_keyboard_parent_container = 986 aura::Window* virtual_keyboard_parent_container =
991 CreateContainer(kShellWindowId_ImeWindowParentContainer, 987 CreateContainer(kShellWindowId_ImeWindowParentContainer,
992 "VirtualKeyboardParentContainer", 988 "VirtualKeyboardParentContainer",
993 lock_screen_related_containers); 989 lock_screen_related_containers);
994 wm::SetSnapsChildrenToPhysicalPixelBoundary( 990 wm::SetSnapsChildrenToPhysicalPixelBoundary(
995 virtual_keyboard_parent_container); 991 virtual_keyboard_parent_container);
996 virtual_keyboard_parent_container->SetLayoutManager(
997 new VirtualKeyboardContainerLayoutManager(
998 virtual_keyboard_parent_container));
999 SetUsesScreenCoordinates(virtual_keyboard_parent_container); 992 SetUsesScreenCoordinates(virtual_keyboard_parent_container);
1000 993
1001 aura::Window* menu_container = CreateContainer( 994 aura::Window* menu_container = CreateContainer(
1002 kShellWindowId_MenuContainer, 995 kShellWindowId_MenuContainer,
1003 "MenuContainer", 996 "MenuContainer",
1004 lock_screen_related_containers); 997 lock_screen_related_containers);
1005 ::wm::SetChildWindowVisibilityChangesAnimated(menu_container); 998 ::wm::SetChildWindowVisibilityChangesAnimated(menu_container);
1006 wm::SetSnapsChildrenToPhysicalPixelBoundary(menu_container); 999 wm::SetSnapsChildrenToPhysicalPixelBoundary(menu_container);
1007 SetUsesScreenCoordinates(menu_container); 1000 SetUsesScreenCoordinates(menu_container);
1008 1001
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 else 1048 else
1056 DisableTouchHudProjection(); 1049 DisableTouchHudProjection();
1057 } 1050 }
1058 1051
1059 RootWindowController* GetRootWindowController( 1052 RootWindowController* GetRootWindowController(
1060 const aura::Window* root_window) { 1053 const aura::Window* root_window) {
1061 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; 1054 return root_window ? GetRootWindowSettings(root_window)->controller : NULL;
1062 } 1055 }
1063 1056
1064 } // namespace ash 1057 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698