| OLD | NEW |
| 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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/display/display_layout.h" | 9 #include "ash/display/display_layout.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "ash/wm/wm_event.h" | 22 #include "ash/wm/wm_event.h" |
| 23 #include "ash/wm/workspace/workspace_window_resizer.h" | 23 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 24 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
| 25 #include "base/compiler_specific.h" | 25 #include "base/compiler_specific.h" |
| 26 #include "ui/aura/client/aura_constants.h" | 26 #include "ui/aura/client/aura_constants.h" |
| 27 #include "ui/aura/test/test_windows.h" | 27 #include "ui/aura/test/test_windows.h" |
| 28 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
| 29 #include "ui/aura/window_event_dispatcher.h" | 29 #include "ui/aura/window_event_dispatcher.h" |
| 30 #include "ui/base/ime/dummy_text_input_client.h" | 30 #include "ui/base/ime/dummy_text_input_client.h" |
| 31 #include "ui/base/ime/input_method.h" | 31 #include "ui/base/ime/input_method.h" |
| 32 #include "ui/base/ime/text_input_focus_manager.h" | |
| 33 #include "ui/base/ui_base_switches_util.h" | |
| 34 #include "ui/base/ui_base_types.h" | 32 #include "ui/base/ui_base_types.h" |
| 35 #include "ui/gfx/geometry/insets.h" | 33 #include "ui/gfx/geometry/insets.h" |
| 36 #include "ui/gfx/screen.h" | 34 #include "ui/gfx/screen.h" |
| 37 #include "ui/views/widget/widget.h" | 35 #include "ui/views/widget/widget.h" |
| 38 #include "ui/views/widget/widget_delegate.h" | 36 #include "ui/views/widget/widget_delegate.h" |
| 39 #include "ui/wm/core/window_util.h" | 37 #include "ui/wm/core/window_util.h" |
| 40 | 38 |
| 41 namespace ash { | 39 namespace ash { |
| 42 namespace { | 40 namespace { |
| 43 | 41 |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 Shell::GetPrimaryRootWindow(), | 1005 Shell::GetPrimaryRootWindow(), |
| 1008 restore_work_area_insets_); | 1006 restore_work_area_insets_); |
| 1009 layout_manager_->OnKeyboardBoundsChanging(gfx::Rect()); | 1007 layout_manager_->OnKeyboardBoundsChanging(gfx::Rect()); |
| 1010 } | 1008 } |
| 1011 | 1009 |
| 1012 void SetKeyboardBounds(const gfx::Rect& bounds) { | 1010 void SetKeyboardBounds(const gfx::Rect& bounds) { |
| 1013 keyboard_bounds_ = bounds; | 1011 keyboard_bounds_ = bounds; |
| 1014 } | 1012 } |
| 1015 | 1013 |
| 1016 void Focus(ui::TextInputClient* text_input_client) { | 1014 void Focus(ui::TextInputClient* text_input_client) { |
| 1017 if (switches::IsTextInputFocusManagerEnabled()) { | 1015 aura::Window* root_window = |
| 1018 ui::TextInputFocusManager::GetInstance()->FocusTextInputClient( | 1016 ash::Shell::GetInstance()->GetPrimaryRootWindow(); |
| 1019 text_input_client); | 1017 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod(); |
| 1020 } else { | 1018 input_method->SetFocusedTextInputClient(text_input_client); |
| 1021 aura::Window* root_window = | |
| 1022 ash::Shell::GetInstance()->GetPrimaryRootWindow(); | |
| 1023 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod(); | |
| 1024 input_method->SetFocusedTextInputClient(text_input_client); | |
| 1025 } | |
| 1026 } | 1019 } |
| 1027 | 1020 |
| 1028 void Blur(ui::TextInputClient* text_input_client) { | 1021 void Blur(ui::TextInputClient* text_input_client) { |
| 1029 if (switches::IsTextInputFocusManagerEnabled()) { | 1022 aura::Window* root_window = |
| 1030 ui::TextInputFocusManager::GetInstance()->BlurTextInputClient( | 1023 ash::Shell::GetInstance()->GetPrimaryRootWindow(); |
| 1031 text_input_client); | 1024 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod(); |
| 1032 } else { | 1025 input_method->SetFocusedTextInputClient(NULL); |
| 1033 aura::Window* root_window = | |
| 1034 ash::Shell::GetInstance()->GetPrimaryRootWindow(); | |
| 1035 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod(); | |
| 1036 input_method->SetFocusedTextInputClient(NULL); | |
| 1037 } | |
| 1038 } | 1026 } |
| 1039 | 1027 |
| 1040 private: | 1028 private: |
| 1041 gfx::Insets restore_work_area_insets_; | 1029 gfx::Insets restore_work_area_insets_; |
| 1042 gfx::Rect keyboard_bounds_; | 1030 gfx::Rect keyboard_bounds_; |
| 1043 WorkspaceLayoutManager* layout_manager_; | 1031 WorkspaceLayoutManager* layout_manager_; |
| 1044 | 1032 |
| 1045 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest); | 1033 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest); |
| 1046 }; | 1034 }; |
| 1047 | 1035 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 occluded_window_bounds.width(), | 1137 occluded_window_bounds.width(), |
| 1150 occluded_window_bounds.height()).ToString(), | 1138 occluded_window_bounds.height()).ToString(), |
| 1151 window->bounds().ToString()); | 1139 window->bounds().ToString()); |
| 1152 HideKeyboard(); | 1140 HideKeyboard(); |
| 1153 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); | 1141 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); |
| 1154 | 1142 |
| 1155 Blur(&text_input_client); | 1143 Blur(&text_input_client); |
| 1156 } | 1144 } |
| 1157 | 1145 |
| 1158 } // namespace ash | 1146 } // namespace ash |
| OLD | NEW |