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

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

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bot failure: cast_shell_linux 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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 keyboard_bounds_ = bounds; 1013 keyboard_bounds_ = bounds;
1014 } 1014 }
1015 1015
1016 void Focus(ui::TextInputClient* text_input_client) { 1016 void Focus(ui::TextInputClient* text_input_client) {
1017 if (switches::IsTextInputFocusManagerEnabled()) { 1017 if (switches::IsTextInputFocusManagerEnabled()) {
1018 ui::TextInputFocusManager::GetInstance()->FocusTextInputClient( 1018 ui::TextInputFocusManager::GetInstance()->FocusTextInputClient(
1019 text_input_client); 1019 text_input_client);
1020 } else { 1020 } else {
1021 aura::Window* root_window = 1021 aura::Window* root_window =
1022 ash::Shell::GetInstance()->GetPrimaryRootWindow(); 1022 ash::Shell::GetInstance()->GetPrimaryRootWindow();
1023 ui::InputMethod* input_method = 1023 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod();
1024 root_window->GetProperty(aura::client::kRootWindowInputMethodKey);
1025 input_method->SetFocusedTextInputClient(text_input_client); 1024 input_method->SetFocusedTextInputClient(text_input_client);
1026 } 1025 }
1027 } 1026 }
1028 1027
1029 void Blur(ui::TextInputClient* text_input_client) { 1028 void Blur(ui::TextInputClient* text_input_client) {
1030 if (switches::IsTextInputFocusManagerEnabled()) { 1029 if (switches::IsTextInputFocusManagerEnabled()) {
1031 ui::TextInputFocusManager::GetInstance()->BlurTextInputClient( 1030 ui::TextInputFocusManager::GetInstance()->BlurTextInputClient(
1032 text_input_client); 1031 text_input_client);
1033 } else { 1032 } else {
1034 aura::Window* root_window = 1033 aura::Window* root_window =
1035 ash::Shell::GetInstance()->GetPrimaryRootWindow(); 1034 ash::Shell::GetInstance()->GetPrimaryRootWindow();
1036 ui::InputMethod* input_method = 1035 ui::InputMethod* input_method = root_window->GetHost()->GetInputMethod();
1037 root_window->GetProperty(aura::client::kRootWindowInputMethodKey);
1038 input_method->SetFocusedTextInputClient(NULL); 1036 input_method->SetFocusedTextInputClient(NULL);
1039 } 1037 }
1040 } 1038 }
1041 1039
1042 private: 1040 private:
1043 gfx::Insets restore_work_area_insets_; 1041 gfx::Insets restore_work_area_insets_;
1044 gfx::Rect keyboard_bounds_; 1042 gfx::Rect keyboard_bounds_;
1045 WorkspaceLayoutManager* layout_manager_; 1043 WorkspaceLayoutManager* layout_manager_;
1046 1044
1047 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest); 1045 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManagerKeyboardTest);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 occluded_window_bounds.width(), 1149 occluded_window_bounds.width(),
1152 occluded_window_bounds.height()).ToString(), 1150 occluded_window_bounds.height()).ToString(),
1153 window->bounds().ToString()); 1151 window->bounds().ToString());
1154 HideKeyboard(); 1152 HideKeyboard();
1155 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); 1153 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString());
1156 1154
1157 Blur(&text_input_client); 1155 Blur(&text_input_client);
1158 } 1156 }
1159 1157
1160 } // namespace ash 1158 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698