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

Side by Side Diff: chrome/browser/ui/ash/keyboard_controller_browsertest.cc

Issue 219503003: Make keyboard controller a singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix root window controller unittets. Created 6 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 | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/input/input.cc ('k') | chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698