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

Side by Side Diff: ui/base/ime/text_input_focus_manager.cc

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added an unittest and thread checker. 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/base/ime/text_input_focus_manager.h"
6
7 #include "base/logging.h"
8 #include "base/memory/singleton.h"
9
10 namespace ui {
11
12 TextInputFocusManager* TextInputFocusManager::GetInstance() {
13 TextInputFocusManager* instance = Singleton<TextInputFocusManager>::get();
14 DCHECK(instance->thread_checker_.CalledOnValidThread());
15 return instance;
16 }
17
18 TextInputClient* TextInputFocusManager::GetFocusedTextInputClient() {
19 DCHECK(thread_checker_.CalledOnValidThread());
20 return focused_text_input_client_;
21 }
22
23 void TextInputFocusManager::FocusTextInputClient(
24 TextInputClient* text_input_client) {
25 DCHECK(thread_checker_.CalledOnValidThread());
26 focused_text_input_client_ = text_input_client;
27 }
28
29 void TextInputFocusManager::BlurTextInputClient(
30 TextInputClient* text_input_client) {
31 DCHECK(thread_checker_.CalledOnValidThread());
32 if (focused_text_input_client_ == text_input_client)
33 focused_text_input_client_ = NULL;
34 }
35
36 TextInputFocusManager::TextInputFocusManager()
37 : focused_text_input_client_(NULL) {}
38
39 TextInputFocusManager::~TextInputFocusManager() {}
40
41 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698