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

Side by Side Diff: ash/test/content/keyboard_controller_proxy_stub.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
« no previous file with comments | « ash/test/content/keyboard_controller_proxy_stub.h ('k') | ash/test/test_keyboard_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/content/keyboard_controller_proxy_stub.h"
6
7 #include "ash/content/shell_content_state.h"
8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h"
10 #include "ash/wm/window_util.h"
11 #include "ui/aura/window.h"
12 #include "ui/aura/window_tree_host.h"
13 #include "ui/base/ime/mock_input_method.h"
14
15 namespace ash {
16
17 KeyboardControllerProxyStub::KeyboardControllerProxyStub()
18 : keyboard::KeyboardControllerProxy(ShellContentState::GetInstance()
19 ->GetActiveBrowserContext()) {}
20
21 KeyboardControllerProxyStub::~KeyboardControllerProxyStub() {}
22
23 bool KeyboardControllerProxyStub::HasKeyboardWindow() const {
24 return keyboard_;
25 }
26
27 aura::Window* KeyboardControllerProxyStub::GetKeyboardWindow() {
28 if (!keyboard_) {
29 keyboard_.reset(new aura::Window(&delegate_));
30 keyboard_->Init(ui::LAYER_NOT_DRAWN);
31 }
32 return keyboard_.get();
33 }
34
35 ui::InputMethod* KeyboardControllerProxyStub::GetInputMethod() {
36 aura::Window* active_window = wm::GetActiveWindow();
37 aura::Window* root_window = active_window ? active_window->GetRootWindow()
38 : Shell::GetPrimaryRootWindow();
39 return root_window->GetHost()->GetInputMethod();
40 }
41
42 void KeyboardControllerProxyStub::RequestAudioInput(
43 content::WebContents* web_contents,
44 const content::MediaStreamRequest& request,
45 const content::MediaResponseCallback& callback) {}
46
47 void KeyboardControllerProxyStub::LoadSystemKeyboard() {}
48
49 void KeyboardControllerProxyStub::ReloadKeyboardIfNeeded() {}
50
51 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/content/keyboard_controller_proxy_stub.h ('k') | ash/test/test_keyboard_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698