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

Side by Side Diff: ash/test/test_keyboard_ui.cc

Issue 1392713002: Extract content dependency from keyboard code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/test/test_keyboard_ui.h"
6
7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h"
9 #include "ash/wm/window_util.h"
10 #include "ui/aura/window.h"
11 #include "ui/aura/window_tree_host.h"
12 #include "ui/base/ime/mock_input_method.h"
13
14 namespace ash {
15
16 TestKeyboardUI::TestKeyboardUI() {}
17 TestKeyboardUI::~TestKeyboardUI() {}
18
19 bool TestKeyboardUI::HasKeyboardWindow() const {
20 return keyboard_;
21 }
22
23 aura::Window* TestKeyboardUI::GetKeyboardWindow() {
24 if (!keyboard_) {
25 keyboard_.reset(new aura::Window(&delegate_));
26 keyboard_->Init(ui::LAYER_NOT_DRAWN);
27 }
28 return keyboard_.get();
29 }
30
31 ui::InputMethod* TestKeyboardUI::GetInputMethod() {
32 aura::Window* active_window = wm::GetActiveWindow();
33 aura::Window* root_window = active_window ? active_window->GetRootWindow()
34 : Shell::GetPrimaryRootWindow();
35 return root_window->GetHost()->GetInputMethod();
36 }
37
38 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698