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

Side by Side Diff: chrome/browser/chromeos/input_method/textinput_test_helper.cc

Issue 1155013005: Refactoring the ownership of ui::InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed. 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/input_method/textinput_test_helper.h" 9 #include "chrome/browser/chromeos/input_method/textinput_test_helper.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/test/base/interactive_test_utils.h" 11 #include "chrome/test/base/interactive_test_utils.h"
12 #include "content/public/browser/render_view_host.h" 12 #include "content/public/browser/render_view_host.h"
13 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
14 #include "content/public/test/browser_test_utils.h" 14 #include "content/public/test/browser_test_utils.h"
15 #include "ui/aura/client/aura_constants.h"
16 #include "ui/aura/window_event_dispatcher.h" 15 #include "ui/aura/window_event_dispatcher.h"
16 #include "ui/aura/window_tree_host.h"
17 #include "ui/base/ime/input_method_factory.h" 17 #include "ui/base/ime/input_method_factory.h"
18 18
19 namespace chromeos { 19 namespace chromeos {
20 namespace { 20 namespace {
21 ui::MockInputMethod* GetInputMethod() { 21 ui::MockInputMethod* GetInputMethod() {
22 ui::MockInputMethod* input_method = static_cast<ui::MockInputMethod*>( 22 ui::MockInputMethod* input_method = static_cast<ui::MockInputMethod*>(
23 ash::Shell::GetPrimaryRootWindow()->GetProperty( 23 ash::Shell::GetPrimaryRootWindow()->GetHost()->GetInputMethod());
24 aura::client::kRootWindowInputMethodKey));
25 CHECK(input_method); 24 CHECK(input_method);
26 return input_method; 25 return input_method;
27 } 26 }
28 } // namespace 27 } // namespace
29 28
30 void TextInputTestBase::SetUpInProcessBrowserTestFixture() { 29 void TextInputTestBase::SetUpInProcessBrowserTestFixture() {
31 ui::SetUpInputMethodFactoryForTesting(); 30 ui::SetUpInputMethodFactoryForTesting();
32 } 31 }
33 32
34 TextInputTestHelper::TextInputTestHelper() 33 TextInputTestHelper::TextInputTestHelper()
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 mouse_event.y = rect.CenterPoint().y(); 200 mouse_event.y = rect.CenterPoint().y();
202 mouse_event.clickCount = 1; 201 mouse_event.clickCount = 1;
203 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 202 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
204 203
205 mouse_event.type = blink::WebInputEvent::MouseUp; 204 mouse_event.type = blink::WebInputEvent::MouseUp;
206 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 205 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
207 return true; 206 return true;
208 } 207 }
209 208
210 } // namespace chromeos 209 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698