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

Side by Side Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 1182523003: Removes TextInputFocusManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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/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
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" 32 #include "ui/base/ui_base_switches_util.h"
34 #include "ui/base/ui_base_types.h" 33 #include "ui/base/ui_base_types.h"
35 #include "ui/gfx/geometry/insets.h" 34 #include "ui/gfx/geometry/insets.h"
36 #include "ui/gfx/screen.h" 35 #include "ui/gfx/screen.h"
37 #include "ui/views/widget/widget.h" 36 #include "ui/views/widget/widget.h"
38 #include "ui/views/widget/widget_delegate.h" 37 #include "ui/views/widget/widget_delegate.h"
39 #include "ui/wm/core/window_util.h" 38 #include "ui/wm/core/window_util.h"
40 39
41 namespace ash { 40 namespace ash {
42 namespace { 41 namespace {
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 Shell::GetPrimaryRootWindow(), 1006 Shell::GetPrimaryRootWindow(),
1008 restore_work_area_insets_); 1007 restore_work_area_insets_);
1009 layout_manager_->OnKeyboardBoundsChanging(gfx::Rect()); 1008 layout_manager_->OnKeyboardBoundsChanging(gfx::Rect());
1010 } 1009 }
1011 1010
1012 void SetKeyboardBounds(const gfx::Rect& bounds) { 1011 void SetKeyboardBounds(const gfx::Rect& bounds) {
1013 keyboard_bounds_ = bounds; 1012 keyboard_bounds_ = bounds;
1014 } 1013 }
1015 1014
1016 void Focus(ui::TextInputClient* text_input_client) { 1015 void Focus(ui::TextInputClient* text_input_client) {
1017 if (switches::IsTextInputFocusManagerEnabled()) { 1016 aura::Window* root_window =
1018 ui::TextInputFocusManager::GetInstance()->FocusTextInputClient( 1017 ash::Shell::GetInstance()->GetPrimaryRootWindow();
1019 text_input_client); 1018 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod();
1020 } else { 1019 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 } 1020 }
1027 1021
1028 void Blur(ui::TextInputClient* text_input_client) { 1022 void Blur(ui::TextInputClient* text_input_client) {
1029 if (switches::IsTextInputFocusManagerEnabled()) { 1023 aura::Window* root_window =
1030 ui::TextInputFocusManager::GetInstance()->BlurTextInputClient( 1024 ash::Shell::GetInstance()->GetPrimaryRootWindow();
1031 text_input_client); 1025 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod();
1032 } else { 1026 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 } 1027 }
1039 1028
1040 private: 1029 private:
1041 gfx::Insets restore_work_area_insets_; 1030 gfx::Insets restore_work_area_insets_;
1042 gfx::Rect keyboard_bounds_; 1031 gfx::Rect keyboard_bounds_;
1043 WorkspaceLayoutManager* layout_manager_; 1032 WorkspaceLayoutManager* layout_manager_;
1044 1033
1045 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest); 1034 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest);
1046 }; 1035 };
1047 1036
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 occluded_window_bounds.width(), 1138 occluded_window_bounds.width(),
1150 occluded_window_bounds.height()).ToString(), 1139 occluded_window_bounds.height()).ToString(),
1151 window->bounds().ToString()); 1140 window->bounds().ToString());
1152 HideKeyboard(); 1141 HideKeyboard();
1153 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); 1142 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString());
1154 1143
1155 Blur(&text_input_client); 1144 Blur(&text_input_client);
1156 } 1145 }
1157 1146
1158 } // namespace ash 1147 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698