| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "chrome/test/base/in_process_browser_test.h" | 7 #include "chrome/test/base/in_process_browser_test.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/public/common/url_constants.h" | 9 #include "content/public/common/url_constants.h" |
| 10 #include "ui/base/ime/dummy_text_input_client.h" | 10 #include "ui/base/ime/dummy_text_input_client.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Ensure that the virtual keyboard is enabled. | 29 // Ensure that the virtual keyboard is enabled. |
| 30 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 30 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 31 command_line->AppendSwitch( | 31 command_line->AppendSwitch( |
| 32 keyboard::switches::kEnableVirtualKeyboard); | 32 keyboard::switches::kEnableVirtualKeyboard); |
| 33 command_line->AppendSwitch( | 33 command_line->AppendSwitch( |
| 34 keyboard::switches::kEnableInputView); | 34 keyboard::switches::kEnableInputView); |
| 35 } | 35 } |
| 36 | 36 |
| 37 keyboard::KeyboardControllerProxy* proxy() { | 37 keyboard::KeyboardControllerProxy* proxy() { |
| 38 return ash::Shell::GetInstance()->keyboard_controller()->proxy(); | 38 return keyboard::KeyboardController::GetInstance()->proxy(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 void SetFocus(ui::TextInputClient* client) { | 42 void SetFocus(ui::TextInputClient* client) { |
| 43 ui::InputMethod* input_method = proxy()->GetInputMethod(); | 43 ui::InputMethod* input_method = proxy()->GetInputMethod(); |
| 44 input_method->SetFocusedTextInputClient(client); | 44 input_method->SetFocusedTextInputClient(client); |
| 45 if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) | 45 if (client && client->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) |
| 46 input_method->ShowImeIfNeeded(); | 46 input_method->ShowImeIfNeeded(); |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 70 GURL(content::kAboutBlankURL)); | 70 GURL(content::kAboutBlankURL)); |
| 71 | 71 |
| 72 SetFocus(&input_client_1); | 72 SetFocus(&input_client_1); |
| 73 EXPECT_EQ(test_api->keyboard_contents()->GetURL(), | 73 EXPECT_EQ(test_api->keyboard_contents()->GetURL(), |
| 74 GURL(keyboard::kKeyboardURL)); | 74 GURL(keyboard::kKeyboardURL)); |
| 75 | 75 |
| 76 SetFocus(&input_client_2); | 76 SetFocus(&input_client_2); |
| 77 EXPECT_EQ(test_api->keyboard_contents()->GetURL(), | 77 EXPECT_EQ(test_api->keyboard_contents()->GetURL(), |
| 78 GURL(content::kAboutBlankURL)); | 78 GURL(content::kAboutBlankURL)); |
| 79 } | 79 } |
| OLD | NEW |